-
Notifications
You must be signed in to change notification settings - Fork 0
79 lines (73 loc) · 1.88 KB
/
Copy pathpull-request.yml
File metadata and controls
79 lines (73 loc) · 1.88 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
71
72
73
74
75
76
name: pull request
on:
push:
branches:
- '*'
- '!main'
pull_request:
types: [opened]
jobs:
test:
runs-on: ubuntu-latest
strategy:
max-parallel: 4
matrix:
db: [postgres]
python-version: [3.8]
include:
- db: postgres
db_port: 5432
services:
postgres:
image: postgres:10
env:
POSTGRES_USER: usercovid
POSTGRES_PASSWORD: ${{ secrets.POSTGRES_PASSWORD }}
POSTGRES_DB: postgres
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
env:
DJANGO_SECRET_KEY: ${{secrets.DJANGO_SECRET_KEY}}
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
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Test with pytest
env:
DB: ${{ matrix.db }}
DB_HOST: 127.0.0.1
DB_PORT: ${{ matrix.db_port }}
DB_PASSWORD: ${{ secrets.POSTGRES_PASSWORD }}
run: |
cd covid_project && ./manage.py test
docker-build:
needs: [test]
runs-on: ubuntu-latest
steps:
-
name: Set up QEMU
uses: docker/setup-qemu-action@v1
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
-
name: Build
id: docker_build
uses: docker/build-push-action@v2
with:
push: false
tags: valentinrault/covid:latest
-
name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}