-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: add environments for different python versions
Test the project against each minor python version in GitHub Actions.
- Loading branch information
1 parent
0266c25
commit 22372c2
Showing
3 changed files
with
685 additions
and
119 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,9 +25,9 @@ jobs: | |
uses: prefix-dev/[email protected] | ||
with: | ||
pixi-version: v0.25.0 | ||
environments: self | ||
environments: default | ||
- name: Run Simple Tests | ||
shell: pixi run -e self bash -e {0} | ||
shell: pixi run -e default bash -e {0} | ||
run: | | ||
gridtk --help | ||
gridtk submit --help | ||
|
@@ -38,38 +38,61 @@ jobs: | |
gridtk delete --help | ||
tests: | ||
strategy: | ||
matrix: | ||
pixi_environment: [test, test-py311, test-py310, test-py39] | ||
runs-on: ubuntu-22.04 | ||
permissions: | ||
# Gives the action the necessary permissions for publishing new | ||
# comments in pull requests. | ||
pull-requests: write | ||
# Gives the action the necessary permissions for pushing data to the | ||
# python-coverage-comment-action branch, and for editing existing | ||
# comments (to avoid publishing multiple comments in the same PR) | ||
contents: write | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- name: Setup Pixi | ||
uses: prefix-dev/[email protected] | ||
with: | ||
pixi-version: v0.25.0 | ||
environments: test | ||
environments: ${{ matrix.pixi_environment }} | ||
- name: Run Tests | ||
run: pixi run -e test test-ci | ||
run: pixi run -e ${{ matrix.pixi_environment }} test-ci | ||
env: | ||
COVERAGE_FILE: ".coverage.${{ matrix.pixi_environment }}" | ||
- name: Store coverage report | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: coverage-${{ matrix.pixi_environment }} | ||
path: .coverage.${{ matrix.pixi_environment }} | ||
|
||
merge-coverage: | ||
name: Merge the coverage reports from multiple coverages | ||
needs: tests | ||
runs-on: ubuntu-22.04 | ||
permissions: | ||
# Gives the action the necessary permissions for publishing new | ||
# comments in pull requests. | ||
pull-requests: write | ||
# Gives the action the necessary permissions for editing existing | ||
# comments (to avoid publishing multiple comments in the same PR) | ||
contents: write | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
- name: Retrieve coverage artifacts | ||
uses: actions/download-artifact@v4 | ||
id: download | ||
with: | ||
pattern: coverage-* | ||
merge-multiple: true | ||
- name: Coverage comment | ||
id: coverage_comment | ||
uses: py-cov-action/python-coverage-comment-action@v3 | ||
with: | ||
GITHUB_TOKEN: ${{ github.token }} | ||
MERGE_COVERAGE_FILES: true | ||
- name: Store Pull Request comment to be posted | ||
uses: actions/upload-artifact@v4 | ||
if: steps.coverage_comment.outputs.COMMENT_FILE_WRITTEN == 'true' | ||
with: | ||
# If you use a different name, update COMMENT_ARTIFACT_NAME accordingly | ||
name: python-coverage-comment-action | ||
# If you use a different name, update COMMENT_FILENAME accordingly | ||
path: python-coverage-comment-action.txt | ||
|
||
doc: | ||
|
Oops, something went wrong.