Skip to content

fix scm (#590)

fix scm (#590) #1470

Workflow file for this run

name: Multi-Backend Tests
on:
workflow_dispatch:
pull_request:
branches:
- main
- dev
push:
branches:
- main
- dev
defaults:
run:
shell: bash
jobs:
test:
name: Run Multi-Backend Tests
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
python-version: ["3.10"] # we usually only need to test the oldest python version
backend: ["jax", "tensorflow", "torch"]
runs-on: ${{ matrix.os }}
env:
KERAS_BACKEND: ${{ matrix.backend }}
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install Dependencies
run: |
python -m pip install -U pip setuptools wheel
pip install .[test]
- name: Install JAX
if: ${{ matrix.backend == 'jax' }}
run: |
pip install -U jax
- name: Install TensorFlow
if: ${{ matrix.backend == 'tensorflow' }}
run: |
pip install -U tensorflow
- name: Install PyTorch
if: ${{ matrix.backend == 'torch' }}
run: |
pip install -U torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu
- name: Show Environment Info
run: |
python --version
pip --version
printenv | sort
pip list
- name: Run Tests
run: |
pytest -x -m "not slow"
- name: Run Slow Tests
# Run slow tests on manual trigger and pushes/PRs to main.
# Limit to one OS and Python version to save compute.
# Multiline if statements are weird, https://github.com/orgs/community/discussions/25641,
# but feel free to convert it.
if: ${{ ((github.event_name == 'workflow_dispatch') || (github.event_name == 'push' && github.ref_name == 'main') || (github.event_name == 'pull_request' && github.base_ref == 'main')) && ((matrix.os == 'windows-latest') && (matrix.python-version == '3.10')) }}
run: |
pytest -m "slow"
- name: Upload test results to Codecov
if: ${{ !cancelled() }}
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
- name: Create Coverage Report
run: |
coverage xml
- name: Upload Coverage Reports to CodeCov
uses: codecov/codecov-action@v4
with:
# do not use the files attribute here, otherwise the reports are not merged correctly
token: ${{ secrets.CODECOV_TOKEN }}