-
Notifications
You must be signed in to change notification settings - Fork 11
104 lines (94 loc) · 2.83 KB
/
ci.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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
name: Django Rest Framework Reactive CI
on:
push:
branches:
- master
tags:
- "[0-9]+.[0-9]+.[0-9]+*"
pull_request:
schedule:
- cron: "30 2 * * *"
workflow_dispatch:
jobs:
test:
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
tox-env: [py36, py37, py38, py39, py310, docs, linters, packaging, migrations]
include:
- tox-env: py36
python-version: 3.6
- tox-env: py37
python-version: 3.7
- tox-env: py38
python-version: 3.8
- tox-env: py39
python-version: 3.9
- tox-env: py310
python-version: "3.10"
- tox-env: docs
python-version: "3.10"
- tox-env: linters
python-version: "3.10"
- tox-env: packaging
python-version: "3.10"
- tox-env: migrations
python-version: "3.10"
services:
postgres:
image: postgres:10-alpine
env:
POSTGRES_USER: drfr
POSTGRES_DB: drfr
POSTGRES_PASSWORD: drfr
ports:
- 5432/tcp
redis:
image: redis:5-alpine
ports:
- 6379/tcp
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install Dependencies
run: |
python -m pip install --upgrade pip tox
- name: Run Tests
run: >
tox -e ${{ matrix.tox-env }}
--skip-missing-interpreters false
--recreate
env:
DRFR_REDIS_PORT: ${{ job.services.redis.ports[6379] }}
DRFR_POSTGRESQL_HOST: localhost
DRFR_POSTGRESQL_NAME: drfr
DRFR_POSTGRESQL_USER: drfr
DFRF_POSTGRESQL_PASS: drfr
DRFR_POSTGRESQL_PORT: ${{ job.services.postgres.ports[5432] }}
- name: Upload coverage to Codecov
if: matrix.tox-env == 'py36' || matrix.tox-env == 'py37' || matrix.tox-env == 'py38' || matrix.tox-env == 'py39' || matrix.tox-env == 'py310'
uses: codecov/codecov-action@v1
with:
file: .coverage
build:
runs-on: ubuntu-20.04
needs: test
if: "startsWith(github.ref, 'refs/tags')"
steps:
- uses: actions/checkout@v1
- name: Set up Python 3.10
uses: actions/setup-python@v1
with:
python-version: "3.10"
- name: Install pep517
run: python -m pip install --user pep517
- name: Build a binary wheel and a source tarball
run: python -m pep517.build --source --binary --out-dir dist/ .
- name: Publish distribution to PyPI
uses: pypa/gh-action-pypi-publish@master
with:
password: ${{ secrets.pypi_password }}