-
Notifications
You must be signed in to change notification settings - Fork 1
38 lines (31 loc) · 892 Bytes
/
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
37
38
name: Test
on:
# run on open merge requests and on main branch
pull_request:
types: [opened, synchronize]
push:
branches:
- main
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- name: Install poetry
run: |
pip install poetry
poetry config virtualenvs.in-project true
- name: Set up cache for dependencies
uses: actions/cache@v2
id: cache
with:
path: .venv
key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}
- name: Ensure cache is healthy
if: steps.cache.outputs.cache-hit == 'true'
run: poetry run pip --version >/dev/null 2>&1 || rm -rf .venv
- name: Install Dependencies
run: poetry install --with dev
- name: pytest
run: poetry run pytest