Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 22 additions & 6 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,27 @@ concurrency:

jobs:
build:
name: Build python tests
name: Run tasks
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ['3.10', '3.11', '3.12', '3.13']
task: [test]
# The include map here is actually used to extend the matrix.
# By passing all keys used in the matrix we append new unique combinations.
# For more information see:
# https://docs.github.com/en/actions/reference/workflows-and-actions/workflow-syntax#example-adding-configurations
include:
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I find the ways to extend GH matrices super obtuse; I have to go back to the docs every time. Can you please use comment(s) to warn the reader about that? I mean this is one of those rare cases where readers are deceived into thinking "How hard to understand could this simple syntax be? I really don't need to spend time finding the documentation".

But yes they do. Otherwise they waste a lot more time.

  • It's really not intuitive that include extends!
  • It's not intuitive either that test does not get overwritten and still runs for 3.13.

So please mention these, and also strongly recommend to open the documentation. It's currently at
https://docs.github.com/en/actions/reference/workflows-and-actions/workflow-syntax#example-adding-configurations but maybe just the section name in the doc is more "permanent" and enough.

Otherwise everything looks good.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a comment with a link to the docs

# Run linter/type checks only on 1 combination
- os: ubuntu-latest
python-version: '3.13'
task: lint
- os: ubuntu-latest
python-version: '3.13'
task: types

steps:
- name: Checkout
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
Expand All @@ -34,23 +48,25 @@ jobs:
working-directory: './check out/'
enable-cache: true

- name: Display Python version
run: python -c "import sys; print(sys.version); print(sys.platform)"

- name: Setup project
run: uv sync --frozen --directory "./check out/"

- name: Run tasks
run: uv run --frozen --directory "./check out/" poe all
- name: Display Python version
run: echo "import sys; print(sys.version); print(sys.platform)" | uv run -

- name: Run ${{ matrix.task }} on ${{ matrix.os }} - ${{ matrix.python-version }}
run: uv run --frozen --directory "./check out/" poe ${{ matrix.task }}

- name: Upload coverage reports
if: ${{ matrix.task == 'test' }}
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: coverage-${{ matrix.os }}-${{ matrix.python-version }}
path: "./check out/.coverage"
include-hidden-files: true

- name: Upload test reports
if: ${{ matrix.task == 'test' }}
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: tests-${{ matrix.os }}-${{ matrix.python-version }}
Expand Down