more caching and cache invalidation #199
This file contains 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
# tox git actions integration was taken from: | |
# https://github.com/ymyzk/tox-gh-actions/tree/e11a29e2e5c73b6e48f5d4ee379f903476d013c0 | |
# Tests unittest pass, documentation builds, and package builds | |
name: Tests | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
jobs: | |
build: | |
runs-on: ${{ matrix.platform }} | |
strategy: | |
matrix: | |
platform: [ubuntu-latest] | |
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setup Python for Pants | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.9" | |
- name: Setup Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- uses: pantsbuild/actions/init-pants@v5-scie-pants | |
with: | |
# v0 makes it easy to bust the cache if needed | |
# just increase the integer to start with a fresh cache | |
gha-cache-key: v1 | |
named-caches-hash: ${{ hashFiles('devtools/python-default.lock') }} | |
# cache-lmdb-store: 'true' | |
- name: Test | |
run: | | |
pants test :: | |
if: success() || failure() | |
- name: Upload test coverage to Codecov | |
uses: codecov/codecov-action@v4 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
files: dist/coverage/python/coverage.xml | |
fail_ci_if_error: true | |
verbose: true | |
- name: Upload pants log | |
uses: actions/upload-artifact@v3 | |
with: | |
name: pants-log | |
path: .pants.d/pants.log | |
if: always() # We want the log even on failures. |