-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🚸 Alternative workflow for running Python tests individually (#52)
* added parallel python test workflow * ♻️ adjust the individual Python testing workflow Signed-off-by: burgholzer <[email protected]> * ✨ allow running Python testing individually Signed-off-by: burgholzer <[email protected]> * 🩹 fix dependency on dist job Signed-off-by: burgholzer <[email protected]> * 🩹 properly name coverage report Signed-off-by: burgholzer <[email protected]> * 🩹 ensure coverage data is uploaded Signed-off-by: burgholzer <[email protected]> --------- Signed-off-by: burgholzer <[email protected]> Co-authored-by: burgholzer <[email protected]>
- Loading branch information
1 parent
6f84e6d
commit 6022c5a
Showing
2 changed files
with
131 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
name: 🐍 • Tests | ||
on: | ||
workflow_call: | ||
inputs: | ||
runs-on: | ||
description: "The platform to run the tests on" | ||
required: true | ||
type: string | ||
python-version: | ||
description: "The Python version to use" | ||
required: true | ||
type: string | ||
session: | ||
description: "The nox session to run (typically 'tests' or 'minimums')" | ||
required: true | ||
type: string | ||
setup-z3: | ||
description: "Whether to set up Z3" | ||
default: false | ||
type: boolean | ||
z3-version: | ||
description: "The version of Z3 to set up" | ||
default: "4.13.0" | ||
type: string | ||
|
||
jobs: | ||
python-tests: | ||
name: 🐍 ${{ inputs.session }} ${{ inputs.python-version }} ${{ inputs.runs-on }} | ||
runs-on: ${{ inputs.runs-on }} | ||
env: | ||
FORCE_COLOR: 3 | ||
GITHUB_TOKEN: ${{ github.token }} | ||
steps: | ||
# check out the repository (including submodules and all history) | ||
- uses: actions/checkout@v4 | ||
with: | ||
submodules: recursive | ||
fetch-depth: 0 | ||
# set up MSVC development environment (Windows only) | ||
- uses: ilammy/msvc-dev-cmd@v1 | ||
# optionally set up Z3 | ||
- if: ${{ inputs.setup-z3 }} | ||
name: Setup Z3 | ||
uses: cda-tum/setup-z3@v1 | ||
with: | ||
version: ${{ inputs.z3-version }} | ||
# set up ccache for faster C++ builds | ||
- name: Setup ccache | ||
uses: Chocobo1/setup-ccache-action@v1 | ||
with: | ||
prepend_symlinks_to_path: false | ||
windows_compile_environment: msvc | ||
override_cache_key: python-tests-${{ inputs.runs-on }}-${{ inputs.python-version }}-${{ inputs.session }} | ||
# set up mold as linker for faster C++ builds (Linux only) | ||
- name: Set up mold as linker (Linux only) | ||
uses: rui314/setup-mold@v1 | ||
# set up uv for faster Python package management | ||
- name: Install the latest version of uv | ||
uses: astral-sh/setup-uv@v4 | ||
with: | ||
version: "latest" | ||
enable-cache: true | ||
# run the nox session (assumes a corresponding nox session exists) with coverage | ||
- name: Test on 🐍 ${{ inputs.python-version }} | ||
run: uvx nox -s ${{ inputs.session }}-${{ inputs.python-version }} --verbose -- --cov --cov-report=xml:coverage-${{ inputs.session }}-${{ inputs.python-version }}-${{ inputs.runs-on }}.xml | ||
# upload the report as an artifact to GitHub so that it can later be uploaded to Codecov | ||
- name: Upload 🐍 coverage report for the ${{ inputs.session }} session on 🐍 ${{ inputs.python-version }} running ${{ inputs.runs-on }} | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: coverage-${{ inputs.session }}-${{ inputs.python-version }}-${{ inputs.runs-on }} | ||
path: coverage-* |