Run unit tests #4901
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: Run unit tests | |
| on: | |
| # pull_request: | |
| push: | |
| workflow_dispatch: | |
| schedule: | |
| # Run every Sunday at 03:53 UTC | |
| - cron: 53 3 * * 0 | |
| jobs: | |
| tests: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: ['3.12'] | |
| steps: | |
| - uses: actions/checkout@v2 | |
| - name: Cache conda packages and test files | |
| uses: actions/cache@v4 | |
| env: | |
| # Increase this value to reset cache | |
| CACHE_NUMBER: 0 | |
| with: | |
| path: | | |
| ~/conda_pkgs_dir | |
| ~/dragons_tests | |
| key: ${{ runner.os }}-${{ env.CACHE_NUMBER }} | |
| - uses: conda-incubator/setup-miniconda@v3 | |
| with: | |
| auto-update-conda: true | |
| channels: conda-forge | |
| python-version: ${{ matrix.python-version }} | |
| - name: Conda info | |
| shell: bash -l {0} | |
| run: | | |
| conda info | |
| conda list | |
| - name: Install packages | |
| shell: bash -l {0} | |
| run: python -m pip install tox tox-conda | |
| - name: Setup DRAGONS_TEST | |
| shell: bash -l {0} | |
| run: echo "DRAGONS_TEST=~/dragons_tests" >> $GITHUB_ENV | |
| - name: Run Tox | |
| shell: bash -l {0} | |
| run: | | |
| tox -r -e py312-unit -v |