build: Fix dependency setup by using dedicated cache step #237
Workflow file for this run
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: Run tests | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
jobs: | |
test: | |
strategy: | |
matrix: | |
os: [ubuntu-latest] | |
python-version: | |
# Add "pypy-3.8", "pypy-3.9" again at some point | |
["3.7", "3.8", "3.9", "3.10", "3.11"] | |
include: | |
- os: macos-latest | |
python-version: "3.7" | |
- os: macos-latest | |
python-version: "3.11" | |
- os: windows-latest | |
python-version: "3.7" | |
- os: windows-latest | |
python-version: "3.11" | |
runs-on: ${{ matrix.os }} | |
defaults: | |
run: | |
shell: bash | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install poetry | |
uses: snok/[email protected] # Pinned newest version to make Windows work | |
with: | |
virtualenvs-create: true | |
virtualenvs-in-project: true | |
installer-parallel: true | |
- name: Install dependencies | |
run: rm poetry.lock && scripts/setup # Ignore poetry.lock | |
- name: Run checks | |
run: scripts/check --dry | |
- name: Test with pytest | |
run: scripts/test | |
- name: Upload coverage | |
uses: codecov/codecov-action@v3 | |
with: | |
name: ${{ matrix.os }} Python ${{ matrix.python-version }} | |
files: ./reports/coverage.xml | |
- name: Publish JUnit reports | |
uses: mikepenz/action-junit-report@v3 | |
if: always() # Always run, even if the previous steps fail | |
with: | |
check_name: Junit reports | |
report_paths: "./reports/*.xml" |