Merge pull request #268 from jschlyter/github_issue_template #201
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: Tests | |
on: | |
- push | |
- pull_request | |
jobs: | |
ruff: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: chartboost/ruff-action@v1 | |
pytest: | |
needs: ruff | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.12" | |
- name: Get full python version | |
id: full-python-version | |
run: | | |
echo version=$(python -c "import sys, platform; print('.'.join(str(v) for v in sys.version_info[:3]) + '_' + platform.machine())") >> $GITHUB_OUTPUT | |
- name: Set up cache | |
uses: actions/cache@v4 | |
with: | |
path: .venv | |
key: ${{ runner.os }}-venv-${{ steps.full-python-version.outputs.version }}-${{ hashFiles('requirements.txt') }} | |
- name: Create virtual environment | |
run: python3 -m venv .venv | |
- name: Install dependencies | |
run: .venv/bin/pip3 install -r requirements.txt | |
- name: Execute tests | |
run: make PYTEST=.venv/bin/pytest test |