-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: Fix
skore
workflow to send coverage report even on PR from forks
- Loading branch information
1 parent
47a7b9f
commit c622923
Showing
4 changed files
with
85 additions
and
70 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,29 @@ | ||
name: | ||
|
||
on: | ||
workflow_run: | ||
workflows: ["Reusable skore workflow"] | ||
types: | ||
- completed | ||
|
||
permissions: | ||
pull-requests: write | ||
|
||
jobs: | ||
send-coverage-message: | ||
runs-on: ubuntu-latest | ||
if: > | ||
github.event.workflow_run.event == 'pull_request' && | ||
github.event.workflow_run.conclusion == 'success' | ||
steps: | ||
- name: Download coverage reports | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: python-coverage | ||
path: coverage/ | ||
- name: Send | ||
uses: MishaKav/pytest-coverage-comment@main | ||
with: | ||
pytest-coverage-path: coverage/coverage.txt | ||
junitxml-path: coverage/coverage.xml | ||
title: pytest coverage report |
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,54 @@ | ||
name: Reusable skore workflow | ||
|
||
on: [workflow_call] | ||
|
||
defaults: | ||
run: | ||
shell: "bash" | ||
|
||
jobs: | ||
test-skore: | ||
strategy: | ||
fail-fast: true | ||
matrix: | ||
os: ["ubuntu-latest", "windows-latest"] | ||
python: ["3.9", "3.10", "3.11", "3.12"] | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python }} | ||
cache: "pip" | ||
- name: Setup | ||
run: | | ||
python -m pip install --upgrade pip | ||
python -m pip install --upgrade pre-commit | ||
python -m pip install --upgrade build | ||
- name: Lint | ||
working-directory: skore/ | ||
run: pre-commit run --all-files ruff | ||
- name: Build | ||
working-directory: skore/ | ||
run: python -m build | ||
- name: Install | ||
working-directory: skore/ | ||
run: wheel=(dist/*.whl); python -m pip install "${wheel}[test]" | ||
- name: Test without coverage | ||
if: matrix.os != 'ubuntu-latest' || matrix.python != '3.12' | ||
timeout-minutes: 10 | ||
working-directory: skore/ | ||
run: python -m pytest --no-cov src/ tests/ | ||
- name: Test with coverage | ||
if: matrix.os == 'ubuntu-latest' && matrix.python == '3.12' | ||
timeout-minutes: 10 | ||
working-directory: skore/ | ||
run: | | ||
mkdir coverage | ||
python -m pytest --junitxml=coverage/coverage.xml --cov=skore src/ tests/ | tee coverage/coverage.txt | ||
- name: Upload coverage reports | ||
if: matrix.os == 'ubuntu-latest' && matrix.python == '3.12' | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: python-coverage | ||
path: skore/coverage/ |
This file was deleted.
Oops, something went wrong.