-
Notifications
You must be signed in to change notification settings - Fork 0
81 lines (72 loc) · 2.46 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
name: CI
on: [push]
env:
COMPOSE_DOCKER_CLI_BUILD: 1
DJANGO_DEBUG: true
DJANGO_EMAIL_BACKEND: "${{ secrets.DJANGO_EMAIL_BACKEND }}"
DJANGO_GCP_STORAGE_BUCKET_NAME: "${{ secrets.DJANGO_GCP_STORAGE_BUCKET_NAME }}"
DJANGO_SECRET_KEY: "${{ secrets.DJANGO_SECRET_KEY }}"
DOCKER_BUILDKIT: 1 # Enable Buildkit and let compose use it to speed up image building
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
GOOGLE_ANALYTICS_ID: "${{ secrets.GOOGLE_ANALYTICS_ID }}"
GOOGLE_APPLICATION_CREDENTIALS: "${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }}"
GOOGLE_CLOUD_PROJECT: "${{ secrets.GOOGLE_CLOUD_PROJECT }}"
POSTGRES_DB: postgres
POSTGRES_HOST: localhost
POSTGRES_PASSWORD: postgres
POSTGRES_PORT: 5432
POSTGRES_USER: postgres
TEST_POSTGRES_DB: idr_server_test
TEST_POSTGRES_HOST: localhost
TEST_POSTGRES_PASSWORD: postgres
TEST_POSTGRES_PORT: 5432
TEST_POSTGRES_USER: postgres
USE_DOCKER: no
jobs:
build:
runs-on: ubuntu-latest
strategy:
max-parallel: 4
matrix:
python-version: ["3.11"]
# Service containers to run with `container-job`
services:
postgres:
image: postgis/postgis:15-3.3
env:
POSTGRES_PASSWORD: postgres
POSTGRES_DB: postgres
POSTGRES_USER: postgres
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
# Maps tcp port 5432 on service container to the host
- 5432:5432
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
# Run all pre-commit hooks on all the files.
# Getting only staged files can be tricky in case a new PR is opened
# since the action is run on a branch in detached head state
- name: Install and run pre-commit
uses: pre-commit/action@v3.0.0
- name: Install Requirements
run: |
sudo apt-get update
sudo apt-get install postgis gdal-bin libgdal-dev
python -m pip install --upgrade pip
python -m pip install tox tox-gh-actions
npm ci
- name: Authenticate to Google Cloud
uses: google-github-actions/auth@v0
with:
credentials_json: "${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }}"
- name: Test with tox
run: tox -r