65 lines (65 loc) · 2.18 KB
/
code.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
name: code
on:
pull_request:
push:
branches:
- master
paths:
- pyproject.toml
- poetry.lock
- "**.py"
- "**.yaml"
jobs:
django-tests:
runs-on: ${{ matrix.os }}
strategy:
max-parallel: 4
matrix:
os: ["ubuntu-latest", "windows-latest", "macos-latest"]
python-version: [3.6, 3.7, 3.8]
steps:
- uses: actions/checkout@v2
# We must fetch all history in order to be able to run Git related tests
- run: |
git fetch --prune --unshallow
git fetch origin master:master
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- uses: actions/cache@v1
if: startsWith(runner.os, 'Linux')
with:
path: ~/.cache/pypoetry
key: ${{ runner.os }}-py${{ matrix.python-version }}-poetry-${{ hashFiles('**/poetry.lock') }}
restore-keys: |
${{ runner.os }}-py-poetry-
- uses: actions/cache@v1
if: startsWith(runner.os, 'Windows')
with:
path: ~\AppData\Local\pypoetry\Cache
key: ${{ runner.os }}-py${{ matrix.python-version }}-poetry-${{ hashFiles('**/poetry.lock') }}
restore-keys: |
${{ runner.os }}-py-poetry-
- uses: actions/cache@v1
if: startsWith(runner.os, 'macOS')
with:
path: ~/Library/Caches/pypoetry
key: ${{ runner.os }}-py${{ matrix.python-version }}-poetry-${{ hashFiles('**/poetry.lock') }}
restore-keys: |
${{ runner.os }}-py-poetry-
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
python -m pip install poetry
python -m poetry install
- name: Run Tests
run: |
python -m poetry run coverage run dunm_sandbox/manage.py test tests
- name: Upload coverage to Coveralls
if: matrix.python-version == '3.6' && matrix.os == 'ubuntu-latest'
env:
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_TOKEN }}
run: |
python -m pip install coverage[toml] coveralls
python -m coveralls