-
Notifications
You must be signed in to change notification settings - Fork 0
70 lines (61 loc) · 2.01 KB
/
pytest.yml
File metadata and controls
70 lines (61 loc) · 2.01 KB
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
name: Unit Tests
on:
pull_request:
paths-ignore:
- 'docs/**'
branches:
- main
- master
- prod
- production
- qa
- dev
- development
jobs:
test:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Check out repository code
uses: actions/checkout@v2
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: "3.9"
- name: Install poetry
run: |
curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python -
echo "$HOME/.poetry/bin" >> $GITHUB_PATH
- name: Configure poetry
env:
FURY_ORG: ${{ secrets.FURY_ORG }}
FURY_AUTH: ${{ secrets.FURY_AUTH }}
run: |
curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python -
echo "$HOME/.poetry/bin" >> $GITHUB_PATH
poetry config virtualenvs.in-project true
poetry config repositories.gemfury "https://pypi.fury.io/${FURY_ORG}/"
poetry config http-basic.gemfury "${FURY_AUTH}" "${FURY_AUTH}"
- name: Cache virtualenv
uses: actions/cache@v2
id: venv_cache
with:
path: .venv
key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}
- name: Cache pre-commit
uses: actions/cache@v2
id: precommit_cache
with:
path: ~/.cache/pre-commit
key: precommit-${{ runner.os }}-${{ hashFiles('pre-commit-config.yaml', 'pre-commit-hooks.yaml') }}
- name: Ensure venv cache is healthy
if: steps.venv_cache.outputs.cache-hit == 'true'
run: timeout 10s poetry run pip --version || rm -rf .venv
- name: Install dependencies
run: poetry install
- name: Install pytest plugin
run: |
poetry run pip install pytest-github-actions-annotate-failures
- name: Run test suite
run: |
poetry run pre-commit run --all-files