Unittests #410
This file contains hidden or 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: Unittests | |
| # Allow to trigger the workflow manually (e.g. when deps changes) | |
| on: | |
| workflow_dispatch: | |
| pull_request: | |
| branches: | |
| - main | |
| types: [opened, synchronize, reopened] | |
| push: | |
| schedule: | |
| # Trigger tests every day at 02:00 UTC. | |
| - cron: '0 2 * * *' | |
| # Concurrency config borrowed from tensorflow_datasets. | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }}-${{ github.ref != 'refs/heads/master' || github.run_number }} | |
| # Cancel only PR intermediate builds | |
| cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }} | |
| # Set the correct env variables for all the unit tests | |
| jobs: | |
| pytest-job: | |
| name: '[${{ matrix.os-version }}][Python ${{ matrix.python-version }}] Core RecurrentGemma tests' | |
| runs-on: ${{ matrix.os-version }} | |
| timeout-minutes: 30 | |
| strategy: | |
| # Do not cancel in-progress jobs if any matrix job fails. | |
| fail-fast: false | |
| matrix: | |
| python-version: ['3.11'] | |
| os-version: [ubuntu-latest] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| # Install deps | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - run: pip --version | |
| - run: pip install -e .[test] | |
| - run: pip freeze | |
| # Run tests | |
| - name: Run core tests | |
| run: | | |
| pytest \ | |
| -vv |