-
Notifications
You must be signed in to change notification settings - Fork 13
workflow: Only triggers relevant tests #107
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
bact
wants to merge
7
commits into
JPEWdev:main
Choose a base branch
from
bact:test-specific-lang
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+225
−55
Open
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
01afc6e
workflow: Only triggers relevant tests
bact 550e14c
Update GitHub Actions in coverage-generate.yaml
bact e35c4c1
Only install go when test go
bact 5b05cb3
Update README
bact 49a244a
Merge branch 'JPEWdev:main' into test-specific-lang
bact e434df9
Update test-files list
bact 2040803
Merge branch 'JPEWdev:main' into test-specific-lang
bact File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,97 @@ | ||
| --- | ||
| # Reusable test runner. To be called from other workflows. | ||
| name: pytest | ||
|
|
||
| on: | ||
| workflow_call: | ||
| inputs: | ||
| test-files: | ||
| description: "Space-separated pytest paths or options/arguments (empty = whole suite)" | ||
| type: string | ||
| default: "" | ||
| python-versions: | ||
| description: "JSON array of Python versions for the matrix" | ||
| type: string | ||
| default: '["3.9", "3.10", "3.11", "3.12", "3.13", "3.14"]' | ||
| install-native-toolchains: | ||
| description: "Install compilers/tools to build & run generated bindings" | ||
| type: boolean | ||
| default: true | ||
| install-go: | ||
| description: >- | ||
| Install Go via brew on macOS. Default false since Go is | ||
| preinstalled on Linux runners and only the golang job needs it. | ||
| type: boolean | ||
| default: false | ||
| install-rust-clippy: | ||
| description: "Install the clippy component (needed by tests/test_rust.py's static analysis test)" | ||
| type: boolean | ||
| default: false | ||
| install-go-staticcheck: | ||
| description: "Install staticcheck (needed by tests/test_golang.py's static analysis test)" | ||
| type: boolean | ||
| default: false | ||
|
|
||
| jobs: | ||
| build: | ||
| runs-on: ${{ matrix.os }} | ||
| strategy: | ||
| matrix: | ||
| os: [ubuntu-latest] | ||
| python-version: ${{ fromJSON(inputs.python-versions) }} | ||
| include: | ||
| - os: macos-latest | ||
| python-version: "3.10" | ||
| steps: | ||
| - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | ||
| - name: Setup Python ${{ matrix.python-version }} | ||
| uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0 | ||
| with: | ||
| python-version: ${{ matrix.python-version }} | ||
| # jsonld-cli is used by the tests (incl. core), so always install it. | ||
| - name: Setup Node | ||
| uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 | ||
| with: | ||
| node-version: 24 | ||
| - name: Install Python build tooling | ||
| run: | | ||
| python -m pip install --upgrade pip | ||
| pip install build | ||
| - name: Install jsonld-cli | ||
| run: | | ||
| npm install -g jsonld-cli | ||
| - name: Install Node test/build scripts | ||
| run: | | ||
| npm --prefix scripts ci | ||
| - name: Install Linux packages | ||
| if: ${{ inputs.install-native-toolchains && runner.os == 'Linux' }} | ||
| run: | | ||
| sudo apt update | ||
| sudo apt install -y build-essential cppcheck doxygen graphviz | ||
| - name: Install macOS packages | ||
| if: ${{ inputs.install-native-toolchains && runner.os == 'macOS' }} | ||
| run: | | ||
| brew update | ||
| brew install cppcheck doxygen gcc graphviz | ||
| - name: Install Go (macOS) | ||
| if: ${{ inputs.install-go && runner.os == 'macOS' }} | ||
| run: | | ||
| brew install go | ||
| - name: Install Rust static analysis tools | ||
| if: ${{ inputs.install-rust-clippy }} | ||
| run: | | ||
| rustup component add clippy | ||
| - name: Install Go static analysis tools | ||
| if: ${{ inputs.install-go-staticcheck }} | ||
| run: | | ||
| echo "$(go env GOPATH)/bin" >> "$GITHUB_PATH" | ||
| go install honnef.co/go/tools/cmd/staticcheck@latest | ||
| - name: Build package | ||
| run: | | ||
| python -m build | ||
| - name: Install package | ||
| run: | | ||
| pip install -e .[dev] | ||
| - name: Run tests | ||
| run: | | ||
| pytest -v ${{ inputs.test-files }} |
This file contains hidden or 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 hidden or 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 hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The "core" here confused me as it's not actually used as the "core" filter below. I think this is only stuff that is common to the language filters? Maybe "common" would be a better name
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"common" will be a better name. agree.