Run unit tests #821
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: | |
| push: | |
| branches: | |
| - '**' | |
| schedule: | |
| - cron: '0 0 * * 1' # Trigger every Monday at midnight (UTC) | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| build: | |
| strategy: | |
| matrix: | |
| python-version: ["3.10", "3.11", "3.12"] | |
| os: [ubuntu-latest, windows-latest, macos-latest] | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| cache: "pip" | |
| cache-dependency-path: "**/pyproject.toml" | |
| - name: Install HDF5 (macOS only) | |
| if: runner.os == 'macOS' | |
| run: | | |
| brew install hdf5 | |
| brew install c-blosc2 | |
| - name: Set HDF5_DIR environment variable (macOS only) | |
| if: runner.os == 'macOS' | |
| run: | | |
| echo "HDF5_DIR=$(brew --prefix hdf5)" >> $GITHUB_ENV | |
| echo "BLOSC2_DIR=$(brew --prefix c-blosc2)" >> $GITHUB_ENV | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install ".[dev]" | |
| - name: Run unit tests | |
| run: | | |
| sh run_tests.sh | |
| if: github.event_name == 'push' || (github.event_name == 'schedule' && github.ref == 'refs/heads/main') |