|
1 | | -name: 'Test and release Yakut' |
| 1 | +name: 'Test & Release' |
2 | 2 | on: [ push, pull_request ] |
3 | 3 |
|
4 | | -# Ensures that only one workflow is running at a time |
5 | | -concurrency: |
6 | | - group: ${{ github.workflow_sha }} |
7 | | - cancel-in-progress: true |
8 | | - |
9 | 4 | jobs: |
10 | | - yakut-test: |
11 | | - name: Test Yakut |
| 5 | + test: |
| 6 | + name: Test |
12 | 7 | # https://docs.github.com/en/webhooks/webhook-events-and-payloads?actionType=edited#pull_request |
13 | 8 | if: (github.event_name == 'push') || github.event.pull_request.head.repo.fork |
14 | 9 | strategy: |
15 | 10 | fail-fast: false |
16 | 11 | matrix: |
17 | | - # The Windows NPcap runner is an ordinary Windows machine with the NPcap driver installed manually. |
18 | | - # We chose to do it this way because NPcap driver installation requires a reboot, which is difficult to |
19 | | - # automate. The NPcap driver is required for the Cyphal/UDP transport tests to work. |
20 | | - os: [ubuntu-22.04, windows-2019-npcap] |
21 | | - python: ['3.8', '3.9', '3.10', '3.11'] |
22 | | - exclude: # We don't test Windows with old Python versions because it takes too much effort. |
23 | | - - os: windows-2019-npcap |
24 | | - python: 3.8 |
25 | | - - os: windows-2019-npcap |
26 | | - python: 3.9 |
| 12 | + os: [ ubuntu-latest ] |
| 13 | + py: [ '3.10', '3.11', '3.12', '3.13' ] |
| 14 | + # On Windows, we select the configurations we test manually because we only have a few runners, |
| 15 | + # and because the infrastructure is hard to maintain using limited resources. |
| 16 | + include: |
| 17 | + - { os: win-pcap, py: '3.12' } |
27 | 18 | runs-on: ${{ matrix.os }} |
| 19 | + env: |
| 20 | + FORCE_COLOR: 1 |
28 | 21 | steps: |
29 | | - - name: Check out |
30 | | - uses: actions/checkout@v3 |
31 | | - |
32 | | - - name: Install Python3 |
33 | | - uses: actions/setup-python@v4 |
| 22 | + - uses: actions/checkout@v4 |
34 | 23 | with: |
35 | | - python-version: ${{ matrix.python }} |
| 24 | + submodules: true |
36 | 25 |
|
37 | | - - name: Log Python version |
38 | | - run: python --version |
| 26 | + - uses: actions/setup-python@v5 |
| 27 | + with: |
| 28 | + python-version: ${{ matrix.py }} |
39 | 29 |
|
40 | | - - name: Install dependencies |
| 30 | + - name: Configure GNU/Linux |
| 31 | + if: ${{ runner.os == 'Linux' }} |
41 | 32 | # language=bash |
42 | 33 | run: | |
43 | | - if [ "$RUNNER_OS" == "Linux" ]; then |
44 | | - sudo apt-get --ignore-missing update || true |
45 | | - sudo apt-get install -y linux-*-extra-$(uname -r) ncat |
46 | | - sudo apt-get install -y libsdl2-2.0-0 # For PySDL2. On Windows/macOS the binaries are pulled from PyPI. |
47 | | - sudo apt-get install -y libasound2-dev # For RtMidi. |
48 | | - fi |
49 | | - git submodule update --init --recursive |
50 | | - python -m pip install --upgrade pip setuptools nox |
51 | | - shell: bash |
| 34 | + python --version |
| 35 | + sudo apt-get --ignore-missing update || true |
| 36 | + sudo apt-get install -y linux-*-extra-$(uname -r) ncat |
| 37 | + sudo apt-get install -y libsdl2-2.0-0 # For PySDL2. On Windows/macOS the binaries are pulled from PyPI. |
| 38 | + sudo apt-get install -y libasound2-dev # For RtMidi. |
52 | 39 |
|
53 | | - - name: Run build and test |
54 | | - # language=bash |
55 | | - run: | |
56 | | - nox --non-interactive --session test --python ${{ matrix.python }} |
57 | | - nox --non-interactive --session lint |
58 | | - shell: bash |
59 | | - env: |
60 | | - FORCE_COLOR: 1 |
| 40 | + # Only one statement per step to ensure the error codes are not ignored by PowerShell. |
| 41 | + - run: python -m pip install --upgrade attrs pip setuptools nox |
| 42 | + - run: nox --non-interactive --session test --python ${{ matrix.py }} |
| 43 | + - run: nox --non-interactive --session lint |
61 | 44 |
|
62 | | - - name: Upload diagnostics |
63 | | - uses: actions/upload-artifact@v3 |
| 45 | + - uses: actions/upload-artifact@v4 |
64 | 46 | if: (success() || failure()) |
65 | 47 | with: |
66 | 48 | # The matrix is shown for convenience but this is fragile because the values may not be string-convertible. |
67 | 49 | # Shall it break one day, feel free to remove the matrix from here. |
68 | | - # The job status is per matrix item, which is super convenient. |
69 | 50 | name: ${{github.job}}-#${{strategy.job-index}}-${{job.status}}-${{join(matrix.*, ',')}} |
70 | 51 | path: "**/*.log" |
71 | | - retention-days: 7 |
| 52 | + retention-days: 90 |
| 53 | + include-hidden-files: true |
72 | 54 |
|
73 | | - yakut-release: |
74 | | - name: Release Yakut |
| 55 | + release: |
| 56 | + name: Release |
75 | 57 | runs-on: ubuntu-latest |
76 | 58 | if: > |
77 | 59 | (github.event_name == 'push') && |
78 | 60 | (contains(github.event.head_commit.message, '#release') || contains(github.ref, '/main')) |
79 | | - needs: yakut-test |
| 61 | + needs: test |
80 | 62 | steps: |
81 | 63 | - name: Check out |
82 | | - uses: actions/checkout@v3 |
| 64 | + uses: actions/checkout@v4 |
| 65 | + with: |
| 66 | + submodules: true |
83 | 67 |
|
84 | 68 | - name: Create distribution wheel |
85 | 69 | # language=bash |
86 | 70 | run: | |
87 | | - git submodule update --init --recursive |
88 | | - python -m pip install --upgrade pip setuptools wheel twine |
| 71 | + python -m pip install --upgrade packaging pip setuptools wheel twine |
89 | 72 | python setup.py sdist bdist_wheel |
90 | 73 |
|
91 | 74 | - name: Get release version |
|
99 | 82 | TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN_YAKUT }} |
100 | 83 |
|
101 | 84 | - name: Push version tag |
102 | | - uses: mathieudutour/github-tag-action@v6.1 |
| 85 | + uses: mathieudutour/github-tag-action@v6.2 |
103 | 86 | with: |
104 | 87 | github_token: ${{ secrets.GITHUB_TOKEN }} |
105 | 88 | custom_tag: ${{ env.yakut_version }} |
|
0 commit comments