-
Notifications
You must be signed in to change notification settings - Fork 28
36 lines (34 loc) · 1.09 KB
/
test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
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