ci: sync configs to pymplate
- add python3.12 - add ruff
This commit is contained in:
parent
fabcbab751
commit
0512488241
9 changed files with 117 additions and 74 deletions
31
.github/workflows/main.yml
vendored
31
.github/workflows/main.yml
vendored
|
@ -5,11 +5,17 @@ on:
|
|||
push:
|
||||
branches: '*'
|
||||
tags: 'v[0-9]+.*' # only trigger on 'release' tags for PyPi
|
||||
# Note that people who fork it need to go to "Actions" tab on their fork and click "I understand my workflows, go ahead and enable them".
|
||||
# Ideally I would put this in the pypi job... but github syntax doesn't allow for regexes there :shrug:
|
||||
pull_request: # needed to trigger on others' PRs
|
||||
# Note that people who fork it need to go to "Actions" tab on their fork and click "I understand my workflows, go ahead and enable them".
|
||||
workflow_dispatch: # needed to trigger workflows manually
|
||||
# todo cron?
|
||||
# todo cron?
|
||||
inputs:
|
||||
debug_enabled:
|
||||
type: boolean
|
||||
description: 'Run the build with tmate debugging enabled (https://github.com/marketplace/actions/debugging-with-tmate)'
|
||||
required: false
|
||||
default: false
|
||||
|
||||
|
||||
jobs:
|
||||
|
@ -17,15 +23,17 @@ jobs:
|
|||
strategy:
|
||||
matrix:
|
||||
platform: [ubuntu-latest, macos-latest, windows-latest]
|
||||
python-version: ['3.8', '3.9', '3.10', '3.11']
|
||||
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
|
||||
exclude: [
|
||||
# windows runners are pretty scarce, so let's only run lowest and highest python version
|
||||
{platform: windows-latest, python-version: '3.9'},
|
||||
{platform: windows-latest, python-version: '3.9' },
|
||||
{platform: windows-latest, python-version: '3.10'},
|
||||
{platform: windows-latest, python-version: '3.11'},
|
||||
|
||||
# same, macos is a bit too slow and ubuntu covers python quirks well
|
||||
{platform: macos-latest , python-version: '3.9' },
|
||||
{platform: macos-latest , python-version: '3.9' },
|
||||
{platform: macos-latest , python-version: '3.10' },
|
||||
{platform: macos-latest , python-version: '3.11' },
|
||||
]
|
||||
|
||||
runs-on: ${{ matrix.platform }}
|
||||
|
@ -46,11 +54,11 @@ jobs:
|
|||
submodules: recursive
|
||||
fetch-depth: 0 # nicer to have all git history when debugging/for tests
|
||||
|
||||
# uncomment for SSH debugging
|
||||
# - uses: mxschmitt/action-tmate@v3
|
||||
- uses: mxschmitt/action-tmate@v3
|
||||
if: ${{ github.event_name == 'workflow_dispatch' && inputs.debug_enabled }}
|
||||
|
||||
# explicit bash command is necessary for Windows CI runner, otherwise it thinks it's cmd...
|
||||
- run: bash scripts/ci/run
|
||||
- run: bash .ci/run
|
||||
|
||||
- if: matrix.platform == 'ubuntu-latest' # no need to compute coverage for other platforms
|
||||
uses: actions/upload-artifact@v3
|
||||
|
@ -71,7 +79,7 @@ jobs:
|
|||
# ugh https://github.com/actions/toolkit/blob/main/docs/commands.md#path-manipulation
|
||||
- run: echo "$HOME/.local/bin" >> $GITHUB_PATH
|
||||
|
||||
- uses: actions/setup-python@v3
|
||||
- uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: '3.8'
|
||||
|
||||
|
@ -84,8 +92,7 @@ jobs:
|
|||
if: github.event_name != 'pull_request' && github.event.ref == 'refs/heads/master'
|
||||
env:
|
||||
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD_TEST }}
|
||||
run: pip3 install --user wheel twine && scripts/release --test
|
||||
# TODO run pip install just to test?
|
||||
run: pip3 install --user --upgrade build twine && .ci/release --test
|
||||
|
||||
- name: 'release to pypi'
|
||||
# always deploy tags to release pypi
|
||||
|
@ -93,4 +100,4 @@ jobs:
|
|||
if: github.event_name != 'pull_request' && startsWith(github.event.ref, 'refs/tags')
|
||||
env:
|
||||
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
|
||||
run: pip3 install --user wheel twine && scripts/release
|
||||
run: pip3 install --user --upgrade build twine && .ci/release --test
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue