ci: add build-wheel - manual workflow #18
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: Test python package | |
on: | |
push: | |
paths: | |
- tests/** | |
- src/** | |
- pyproject.toml | |
- .github/workflows/test.yml | |
pull_request: | |
workflow_dispatch: | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
os: [ubuntu-latest, windows-latest, macos-latest] | |
backend: ['torch','jax','tensorflow'] | |
python-version: ['3.10','3.11','3.12'] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install pip | |
run: python -m pip install -U pip | |
- name: Install package | |
run: python -m pip install -e .[dev,test] | |
# Run keras backend specific tests (for keras>=3) | |
# Due to space issues avoid creating too many venvs (via tox) | |
# see https://github.com/actions/runner-images/issues/709 | |
- name: Run tests - ${{ matrix.backend }} backend | |
run: KERAS_BACKEND=${{ matrix.backend }} pytest -v --timeout=120 --cov=damast --cov-report=term --junitxml=junit/test-results-${{ matrix.os }}-${{ matrix.python-version }}-${{ matrix.backend }}.xml tests | |
- name: Upload pytest results | |
uses: actions/upload-artifact@v4 | |
with: | |
name: pytest-results-${{ matrix.os }}-${{ matrix.python-version }}-${{ matrix.backend }} | |
path: junit/test-results-${{ matrix.os }}-${{ matrix.python-version }}-${{ matrix.backend }}.xml | |
# Publish also in case of test failures | |
if: always() |