-
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
b19127c
commit 5f7d570
Showing
6 changed files
with
119 additions
and
80 deletions.
There are no files selected for viewing
Validating CODEOWNERS rules …
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 @@ | ||
/.github/ @thomass-dev @rouk1 @augustebaum |
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 |
---|---|---|
@@ -1,68 +1,83 @@ | ||
name: Reusable skore workflow | ||
# THIS | ||
# IS | ||
# DOCUMENTATION | ||
# REUSABLE WORKFLOW | ||
|
||
name: backend | ||
|
||
on: [workflow_call] | ||
|
||
defaults: | ||
run: | ||
shell: "bash" | ||
working-directory: "./skore" | ||
|
||
jobs: | ||
test-skore: | ||
lint-backend: | ||
runs-on: "ubuntu-latest" | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.12" | ||
cache: pip | ||
|
||
- name: Install dependencies | ||
run: python -m pip install --upgrade pip pre-commit | ||
|
||
- name: Lint | ||
working-directory: skore/ | ||
run: pre-commit run --all-files ruff | ||
|
||
test-backend: | ||
strategy: | ||
fail-fast: true | ||
matrix: | ||
os: ["ubuntu-latest", "windows-latest"] | ||
python-version: ["3.9", "3.10", "3.11", "3.12"] | ||
python: ["3.9", "3.10", "3.11", "3.12"] | ||
coverage: [false] | ||
include: | ||
- os: "ubuntu-latest" | ||
python: "3.12" | ||
coverage: true | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
cache: "pip" | ||
- name: | ||
timeout-minutes: 10 | ||
run: | | ||
# Install dependencies | ||
python -m pip install --upgrade pip | ||
python -m pip install --upgrade pre-commit | ||
python -m pip install --upgrade build | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
# Lint | ||
pre-commit run --all-files ruff | ||
- name: Setup Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python }} | ||
cache: pip | ||
|
||
# Build | ||
python -m build | ||
- name: Install dependencies | ||
run: python -m pip install --upgrade pip build | ||
|
||
# Install | ||
wheel=(dist/*.whl); python -m pip install "${wheel}[test]" | ||
- name: Build | ||
working-directory: skore/ | ||
run: python -m build | ||
|
||
# Test | ||
python -m pytest --no-cov src/ tests/ -n auto | ||
- name: Install | ||
working-directory: skore/ | ||
run: wheel=(dist/*.whl); python -m pip install "${wheel}[test]" | ||
|
||
coverage-skore: | ||
runs-on: ubuntu-latest | ||
if: ${{ github.event_name == 'pull_request' }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: 3.12 | ||
cache: "pip" | ||
- name: pytest coverage | ||
- name: Test with/without coverage | ||
timeout-minutes: 10 | ||
working-directory: skore/ | ||
run: | | ||
# Install dependencies | ||
python -m pip install --upgrade pip | ||
python -m pip install --upgrade pre-commit | ||
python -m pip install --upgrade build | ||
python -m pip install -e .[test] | ||
if [ ${{ matrix.coverage }} = false ] ; then | ||
python -m pytest -n auto --no-cov src/ tests/ | ||
else | ||
mkdir coverage | ||
python -m pytest -n auto --junitxml=coverage/coverage.xml --cov=skore src/ tests/ | tee coverage/coverage.txt | ||
fi | ||
# run coverage | ||
python -m pytest -n auto --junitxml=coverage.xml --cov=skore src/ tests/ | tee pytest-coverage.txt | ||
- name: Pytest coverage comment | ||
uses: MishaKav/pytest-coverage-comment@main | ||
- name: Upload coverage reports | ||
if: matrix.coverage == 'true' | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
pytest-coverage-path: ./skore/pytest-coverage.txt | ||
junitxml-path: ./skore/coverage.xml | ||
title: pytest coverage report | ||
name: backend-coverage | ||
path: skore/coverage/ |
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
59 changes: 38 additions & 21 deletions
59
.github/workflows/skore-ui.yml → .github/workflows/frontend.yml
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 |
---|---|---|
@@ -1,62 +1,79 @@ | ||
name: Reusable skore-ui workflow | ||
# THIS | ||
# IS | ||
# DOCUMENTATION | ||
# REUSABLE WORKFLOW | ||
|
||
name: frontend | ||
|
||
on: [workflow_call] | ||
|
||
defaults: | ||
run: | ||
shell: 'bash' | ||
working-directory: './skore-ui' | ||
|
||
jobs: | ||
lint-skore-ui: | ||
lint-frontend: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-node@v4 | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Node | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: '20' | ||
cache: 'npm' | ||
cache-dependency-path: skore-ui/package-lock.json | ||
- name: Lint skore-ui | ||
|
||
- name: Lint | ||
working-directory: skore-ui/ | ||
run: | | ||
npm install | ||
npm run type-check | ||
npm run lint | ||
npm run format | ||
npm run style-lint | ||
test-skore-ui: | ||
test-frontend: | ||
runs-on: ubuntu-latest | ||
needs: lint-skore-ui | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-node@v4 | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Node | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: '20' | ||
cache: 'npm' | ||
cache-dependency-path: skore-ui/package-lock.json | ||
- name: Test skore-ui | ||
|
||
- name: Test with coverage | ||
working-directory: skore-ui/ | ||
run: | | ||
npm install | ||
npm run test:unit:coverage | ||
- name: Report coverage | ||
if: always() | ||
uses: davelosert/vitest-coverage-report-action@v2 | ||
- name: Upload coverage reports | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
working-directory: ./skore-ui | ||
pr-number: ${{ github.event.number }} | ||
name: frontend-coverage | ||
path: skore-ui/coverage/ | ||
|
||
build-skore-ui: | ||
build-frontend: | ||
runs-on: ubuntu-latest | ||
needs: test-skore-ui | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-node@v4 | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Node | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: '20' | ||
cache: 'npm' | ||
cache-dependency-path: skore-ui/package-lock.json | ||
- name: Build skore-ui | ||
|
||
- name: Build | ||
working-directory: skore-ui/ | ||
run: | | ||
npm install | ||
npm run build |
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
File renamed without changes.