ci: Modularize CI pipeline and test Python >= 3.11 #51
Workflow file for this run
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
name: Backend | |
on: | |
pull_request: | |
paths: | |
- 'src/**' | |
- 'tests/**' | |
- 'pyproject.toml' | |
- 'Makefile' | |
- 'requirements*.txt' | |
- '.github/workflows/backend.yml' | |
permissions: | |
contents: read | |
jobs: | |
build-frontend: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
cache: 'npm' | |
cache-dependency-path: frontend/package-lock.json | |
- shell: bash | |
run: | | |
cd frontend | |
npm install | |
npm run build | |
npm run build:lib | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: frontend-package-distributions | |
path: frontend/dist/* | |
test-backend: | |
runs-on: ubuntu-latest | |
needs: build-frontend | |
continue-on-error: ${{ matrix.python-version != '3.12' }} | |
strategy: | |
fail-fast: true | |
matrix: | |
python-version: ['3.12'] # ['3.9', '3.10', '3.11', '3.12'] | |
steps: | |
- name: Download package distributions | |
uses: actions/download-artifact@v4 | |
with: | |
name: frontend-package-distributions | |
path: src/skore/ui/static # ? | |
- shell: bash | |
run: | | |
ls -lAF --group-directories-first src/skore/ui/static | |
exit -1 | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
cache: 'pip' | |
- name: Lint | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install --upgrade pre-commit | |
pre-commit run --all-files ruff | |
- name: Download package distributions | |
uses: actions/download-artifact@v4 | |
with: | |
name: frontend-package-distributions | |
path: src/skore/ui/static # ? | |
merge-multiple: true # ? | |
- name: Build | |
run: | | |
python -m pip install --upgrade build | |
python -m build | |
- name: Install | |
run: | | |
python -m pip install dist/*.whl --no-dependencies | |
python -m pip install -r requirements.txt -r requirements-test.txt | |
- name: Test | |
timeout-minutes: 5 | |
run: python -m pytest | |
cleanup: | |
runs-on: ubuntu-latest | |
if: always() | |
needs: test-backend | |
steps: | |
- uses: geekyeggo/delete-artifact@v5 | |
with: | |
name: frontend-package-distributions |