-
Notifications
You must be signed in to change notification settings - Fork 1
113 lines (99 loc) · 2.82 KB
/
main.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
105
106
107
108
109
110
111
112
113
name: CI
# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the main branch
push:
branches: [main]
pull_request:
branches: [main]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
tests:
runs-on: ubuntu-latest
container:
image: python:3.10
services:
postgres:
image: postgis/postgis:latest
env:
POSTGRES_DB: terra
POSTGRES_PASSWORD: postgres
POSTGRES_USER: postgres
ports:
- 5432:5432
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
redis:
image: redis
ports:
- 6379:6379
env:
DB_HOST: postgres
DB_PORT: 5432
DB_USER: postgres
DB_PASSWORD: postgres
DB_NAME: terra
RQ_REDIS_URL: redis://redis:6379/0
SECRET_KEY: enter-secret-key
TILES_BUCKET: dym-platform-test-tiles
FILES_BUCKET: dym-platform-test-files
TASK_ARTIFACTS_BUCKET: dym-platform-test-task-artifacts
MODELS_BUCKET: dym-platform-test-models
ALLOWED_HOSTS: localhost,127.0.0.1
DEBUG: 1
steps:
- uses: actions/checkout@v2
- id: "auth"
uses: "google-github-actions/auth@v0"
with:
credentials_json: "${{ secrets.GCP_CREDENTIALS }}"
- name: "Set up Cloud SDK"
uses: "google-github-actions/setup-gcloud@v0"
- name: "Use gcloud CLI"
run: "gcloud info"
- name: Install system dependencies
run: |
apt-get update && apt-get install -y --no-install-recommends \
binutils \
gdal-bin \
gettext \
libasound2 \
libgbm-dev \
libgconf-2-4 \
libgdal-dev \
libgtk-3-0 \
libgtk2.0-0 \
libnotify-dev \
libnss3 \
libproj-dev \
libspatialindex-dev \
libxss1 \
libxtst6 \
postgresql-client \
proj-bin \
python3-dev \
xauth \
xvfb
- name: Set up Poetry
run: |
pip3 install poetry
shell: bash
- name: Install Terra dependencies
run: |
cd terra/ && poetry install
- name: Run Terra tests and generate coverage report
run: |
cd terra/
poetry run coverage run manage.py test
poetry run coverage xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v2
with:
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos
root_dir: terra/