-
Notifications
You must be signed in to change notification settings - Fork 9
56 lines (45 loc) · 1.34 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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
name: Run Unit Tests
on: push
jobs:
test:
runs-on: ubuntu-latest
env:
DJANGO_SETTINGS_MODULE: 'backend.settings.lint'
steps:
- name: Checkout repository
uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: '3.9'
- name: Cache Python modules
uses: actions/cache@v1
env:
cache-name: cache-node-modules
with:
path: ~/.pip
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/poetry.lock') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Install Poetry
run: curl -sSL https://install.python-poetry.org | python3 -
- name: Disable Virtualenvs
run: $HOME/.local/bin/poetry config virtualenvs.create false
- name: Install Python Dependencies
run: $HOME/.local/bin/poetry install --no-interaction --no-ansi
env:
PIP_CACHE_DIR: ~/.pip
- name: Run Tests
run: make coverage
- name: Upload to CodeCov
uses: codecov/codecov-action@v1
with:
files: ./coverage.xml
fail_ci_if_error: true
verbose: true
- name: Publish Coverage XML
uses: actions/upload-artifact@v2
with:
name: coverage.xml
path: ./coverage.xml