-
Notifications
You must be signed in to change notification settings - Fork 0
42 lines (40 loc) · 1.16 KB
/
tests.yaml
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
37
38
39
40
41
42
# only has to pass for python 3.9
name: PyTest Unit Tests
on:
push:
branches:
main
pull_request:
branches:
main
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Python 3.9
uses: actions/setup-python@v3
with:
python-version: 3.9
# Display the Python version being used
- name: Display Python version
run: python -c "import sys; print(sys.version)"
- name: Install and configure Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true
- name: Set up cache
uses: actions/cache@v2
id: cached-poetry-dependencies
with:
path: .venv
key: venv-${{ runner.os }}-${{ steps.full-python-version.outputs.version }}-${{ hashFiles('**/poetry.lock') }}
- name: Install dependencies
run: poetry install --with test
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
- name: Run Tests
run: |
source .venv/bin/activate
pytest florist/tests/*