-
Notifications
You must be signed in to change notification settings - Fork 0
54 lines (51 loc) · 1.41 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
name: Continuous Integration
on: [push]
jobs:
tox:
strategy:
fail-fast: false
matrix:
toxenv: [py39-django32, flake8, mypy]
name: Tox
runs-on: ubuntu-latest
env:
TOXENV: ${{matrix.toxenv}}
services:
postgres:
image: postgres:10.8
env:
POSTGRES_DB: postgres
POSTGRES_USER: postgres
POSTGRES_PASSWORD: ""
ports:
- 5432/tcp
# needed because the postgres container does not provide a healthcheck
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python setup.py install
pip install tox
- name: Prepare database
env:
PGPORT: ${{ job.services.postgres.ports['5432'] }}
run: python manage.py migrate --settings tests.settings
- name: tox (${{matrix.toxenv}})
env:
PGPORT: ${{ job.services.postgres.ports['5432'] }}
run: tox
deploy:
runs-on: ubuntu-latest
if: ${{ github.ref == 'refs/heads/master' }}
needs: [tox]
steps:
- name: Trigger Deploy
env:
BUILDTRIGGER_URL: ${{ secrets.BUILDTRIGGER_URL }}
run: |
curl -k -X POST $BUILDTRIGGER_URL