-
Notifications
You must be signed in to change notification settings - Fork 13
32 lines (29 loc) · 834 Bytes
/
Copy pathpython_tests.yml
File metadata and controls
32 lines (29 loc) · 834 Bytes
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
name: Python application test
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Cache Python environment
id: cache-python-env
uses: actions/cache@v3
with:
path: .venv
key: ${{ runner.os }}-venv-${{ hashFiles('**/requirements.txt', '**/.python-version') }}
restore-keys: |
${{ runner.os }}-venv-
- name: Install Python environment
if: steps.cache-python-env.outputs.cache-hit != 'true'
run: |
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
- name: Test with pytest
run: |
source .venv/bin/activate
pytest