-
Notifications
You must be signed in to change notification settings - Fork 20
79 lines (72 loc) · 2.27 KB
/
django.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
name: Roundware Server CI
on:
push:
pull_request:
jobs:
test:
container:
image: ubuntu:24.04
runs-on: ubuntu-latest
strategy:
max-parallel: 4
matrix:
python-version: [3.12]
services:
# Label used to access the service container
postgres:
# Docker Hub image
image: postgis/postgis
ports:
# will assign a random free host port
- 5432:5432
# Provide the password for postgres
env:
POSTGRES_PASSWORD: round
POSTGRES_USER: round
POSTGRES_DB: roundware
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v2
- name: Install Dependencies
run: |
apt-get update
DEBIAN_FRONTEND=noninteractive xargs -a requirements.apt apt-get install -y --fix-missing
python3 --version
python3 -m pip install --upgrade pip setuptools
python3 -m pip install .[test]
echo "PYTHONPATH=$GITHUB_WORKSPACE:$PYTHONPATH" >> $GITHUB_ENV
- name: Run Tests
env:
ROUNDWARE_DB_USER: round
ROUNDWARE_DB_NAME: roundware
ROUNDWARE_DB_PASSWORD: round
ROUNDWARE_DB_HOST: postgres
ROUNDWARE_DB_PORT: ${{ job.services.postgres.ports[5432] }}
run: |
coverage run --source=roundware roundware/manage.py test --settings=roundware.settings.testing
coverage report -m > coverage-report.txt
cat coverage-report.txt
# - uses: actions/upload-artifact@v2
# with:
# path: coverage-report.txt
build:
runs-on: ubuntu-latest
if: github.event_name != 'pull_request'
steps:
- uses: actions/checkout@master
#This Action Emits 2 Variables, IMAGE_SHA_NAME and IMAGE_URL
#which you can reference in subsequent steps
- name: Publish Docker Image to GPR
uses: machine-learning-apps/gpr-docker-publish@master
id: docker
with:
IMAGE_NAME: 'roundware'
DOCKERFILE_PATH: './Dockerfile'
BUILD_CONTEXT: '.'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}