Skip to content

Keras Tests

Keras Tests #56

Workflow file for this run

name: Keras Tests
# TODO: Consider enabling all tests (pytest, applications, etc.) with NNX in the future
# Currently only basic flow tests run with NNX enabled
on:
push:
branches: [ master ]
pull_request_review:
types: [submitted]
release:
types: [created]
permissions:
contents: read
jobs:
test-in-container:
name: Run tests on TPU
runs-on: linux-x86-ct6e-44-1tpu
# Only run on approved PRs, pushes to master, or releases
if: |
github.event_name == 'push' ||
github.event_name == 'release' ||
(github.event_name == 'pull_request_review' && github.event.review.state == 'approved')
strategy:
fail-fast: false
matrix:
backend: [jax]
container:
image: python:3.10-slim
options: --privileged --network host
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Install Dependencies
run: |
pip install --no-cache-dir -r requirements-${{ matrix.backend }}-tpu.txt \
- name: Set Keras Backend
run: echo "KERAS_BACKEND=jax" >> $GITHUB_ENV
- name: Run Verification and Tests
run: |
echo "Successfully running inside the public python container!"
echo "Verifying JAX installation..."
python3 -c "import jax; print(f'JAX backend: {jax.default_backend()}'); print(f'JAX devices : {jax.devices()}')"
pytest keras --ignore keras/src/applications \
--cov=keras \
--cov-config=pyproject.toml