Update actions/setup-python action to v5 #448
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
name: test | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
concurrency: | |
group: > | |
${{ github.workflow }} @ | |
${{ github.event.pull_request.head.label || github.head_ref || github.ref }} | |
cancel-in-progress: true | |
jobs: | |
test: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
python-version: ["3.7"] | |
os: ["ubuntu-latest", "windows-latest", "macos-latest"] | |
include: | |
# set OS-specific cache paths | |
- os: ubuntu-latest | |
path: ~/.cache/pip | |
- os: windows-latest | |
path: ~\AppData\Local\pip\Cache | |
- os: macos-latest | |
path: ~/Library/Caches/pip | |
# more combinations: | |
- os: ubuntu-latest | |
python-version: "pypy3.9" | |
path: ~/.cache/pip | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Restore Rust/Cargo cache | |
uses: actions/cache/restore@v3 | |
with: | |
path: | | |
~/.cargo/bin/ | |
~/.cargo/registry/index/ | |
~/.cargo/registry/cache/ | |
~/.cargo/git/db/ | |
target/ | |
key: ${{ runner.os }}-rust-v3-${{ hashFiles('**/Cargo.lock') }} | |
- name: Restore Python/pip cache | |
uses: actions/cache/restore@v3 | |
with: | |
path: ${{ matrix.path }} | |
key: ${{ runner.os }}-python-v2-${{ hashFiles('**/requirements.txt') }} | |
restore-keys: | | |
${{ runner.os }}-python-v2- | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -v -e .[test] | |
shell: bash | |
- name: Run Cargo tests | |
run: | | |
cargo test --no-default-features | |
# XXX doesn't work on Pypy due to some shared lib issues... | |
if: "!startsWith(matrix.python-version, 'pypy')" | |
- name: Run pytest tests | |
run: | | |
pytest | |
- name: Save Rust/Cargo cache | |
uses: actions/cache/save@v3 | |
if: always() | |
with: | |
path: | | |
~/.cargo/bin/ | |
~/.cargo/registry/index/ | |
~/.cargo/registry/cache/ | |
~/.cargo/git/db/ | |
target/ | |
key: ${{ runner.os }}-rust-v3-${{ hashFiles('**/Cargo.lock') }} | |
- name: Save Python/pip cache | |
uses: actions/cache/save@v3 | |
if: always() | |
with: | |
path: ${{ matrix.path }} | |
key: ${{ runner.os }}-python-v2-${{ hashFiles('**/requirements.txt') }} |