update versions in CI #2243
Workflow file for this run
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: tests | |
| on: | |
| push: | |
| branches: [ main ] | |
| pull_request: | |
| branches: [ main ] | |
| jobs: | |
| tests: | |
| runs-on: ${{ matrix.os }} | |
| defaults: | |
| run: | |
| # Use a login shell, so that ~/.bash_profile is executed and | |
| # the conda environment gets initialised. | |
| shell: bash -l {0} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, macos-latest, windows-latest] | |
| python: ["3.9", "3.12"] | |
| env: | |
| CONDA_ENV_NAME: stdpopsim | |
| OS: ${{ matrix.os }} | |
| PYTHON: ${{ matrix.python }} | |
| steps: | |
| - name: cancel previous runs | |
| uses: styfle/[email protected] | |
| with: | |
| access_token: ${{ github.token }} | |
| - name: checkout | |
| uses: actions/checkout@v3 | |
| - name: find conda | |
| id: find-conda | |
| run: | | |
| echo "CONDA=$CONDA" >> $GITHUB_OUTPUT | |
| - name: cache conda | |
| id: cache | |
| uses: actions/cache@v4 | |
| env: | |
| # Increase this to reset the cache if the key hasn't changed. | |
| CACHE_NUM: 11 | |
| with: | |
| path: | | |
| ${{ steps.find-conda.outputs.CONDA }}/envs/${{ env.CONDA_ENV_NAME }} | |
| ~/.bash_profile | |
| key: ${{ runner.os }}-${{ matrix.python }}-conda-${{ hashFiles('requirements/CI/*') }}-${{ env.CACHE_NUM }} | |
| - name: install conda | |
| uses: conda-incubator/setup-miniconda@v3 | |
| if: steps.cache.outputs.cache-hit != 'true' | |
| with: | |
| activate-environment: ${{ env.CONDA_ENV_NAME }} | |
| python-version: ${{ matrix.python }} | |
| channels: conda-forge | |
| channel-priority: strict | |
| auto-update-conda: true | |
| - name: Fix windows .profile | |
| if: steps.cache.outputs.cache-hit != 'true' && runner.os == 'Windows' | |
| run: | | |
| cp ~/.bash_profile ~/.profile | |
| - name: install dependencies | |
| if: steps.cache.outputs.cache-hit != 'true' | |
| run: | | |
| # We install msprime from conda to avoid GSL-related build issues | |
| # when pip installing without binary wheels (on Windows). | |
| conda install --yes --file=requirements/CI/conda.txt | |
| pip install -r requirements/CI/requirements.txt | |
| - name: run test suite | |
| run: | | |
| python -m pytest \ | |
| -n 0 \ | |
| -v \ | |
| --cov=stdpopsim \ | |
| --cov-branch \ | |
| --cov-report=term-missing \ | |
| --cov-report=xml \ | |
| tests | |
| - name: upload coverage report to codecov | |
| uses: codecov/codecov-action@v3 | |
| with: | |
| fail_ci_if_error: true | |
| env_vars: OS,PYTHON | |
| # Use upload token to avoid upload failures. | |
| # https://github.com/codecov/codecov-action/issues/837 | |
| token: 8ae76ade-9d0e-4a2d-b9ef-1180235be07f |