[WIP] fix pooch data cacheing #425
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: "CI" | |
| on: | |
| pull_request: | |
| branches: | |
| - main | |
| push: | |
| branches: | |
| - main | |
| schedule: | |
| # At 07:00 UTC on Monday and Thursday. | |
| - cron: "0 7 * * *" | |
| workflow_dispatch: | |
| defaults: | |
| run: | |
| shell: bash -leo pipefail {0} | |
| jobs: | |
| tests: | |
| runs-on: ${{ matrix.os}} | |
| name: "💻-${{matrix.os }} 🐍-${{ matrix.python-version }}" | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: ["ubuntu-latest", "macos-latest"] | |
| python-version: | |
| - "3.11" | |
| - "3.12" | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Get current date | |
| id: date | |
| run: echo "date=$(date +%Y-%m-%d)" >> "${GITHUB_OUTPUT}" | |
| - name: "Setup Micromamba" | |
| uses: mamba-org/setup-micromamba@v2 | |
| with: | |
| environment-file: environment.yml | |
| environment-name: openfe_analysis_env | |
| cache-environment: true | |
| cache-downloads: true | |
| cache-environment-key: environment-${{ steps.date.outputs.date }} | |
| cache-downloads-key: downloads-${{ steps.date.outputs.date }} | |
| create-args: >- | |
| python=${{ matrix.python-version }} | |
| init-shell: bash | |
| - name: "Install" | |
| run: | | |
| python -m pip install --no-deps . | |
| - name: "Test imports" | |
| run: | | |
| python -Ic "import openfe_analysis; print(openfe_analysis.__version__)" | |
| - name: Cache Pooch data | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| # linux cache location | |
| ~/.cache/openfe | |
| # osx cache location | |
| ~/Library/Caches/openfe | |
| # When files are added or changed in a pooch registry | |
| # bump this key to create a new cache, for example if | |
| # the key is pooch-${{ matrix.os }}-1 change it to pooch-${{ matrix.os }}-2 | |
| key: pooch-${{ matrix.os }}-1 | |
| - name: "Run tests" | |
| run: | | |
| pytest -n auto -v --cov=openfe_analysis --cov-report=xml --durations=10 | |
| - name: codecov | |
| if: ${{ github.repository == 'OpenFreeEnergy/openfe_analysis' | |
| && github.event_name == 'pull_request' }} | |
| uses: codecov/codecov-action@v4 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| file: coverage.xml | |
| fail_ci_if_error: false | |
| verbose: true |