-
Notifications
You must be signed in to change notification settings - Fork 0
60 lines (60 loc) · 1.76 KB
/
test-and-validate.yaml
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
name: Test and validate
on:
push:
branches: [ main]
paths:
- '.github/workflows/test-and-validate.yaml'
- 'requirements*.txt'
- 'download.py'
- 'test_download.py'
- 'source.schema.json'
- 'sources.json'
pull_request:
branches: [ main ]
paths:
- '.github/workflows/test-and-validate.yaml'
- 'requirements*.txt'
- 'download.py'
- 'test_download.py'
- 'source.schema.json'
- 'sources.json'
env:
DATABASE_URL: "postgresql://postgres:postgres@postgres:5432/postgres"
AWS_ENDPOINT_URL: "https://nrs.objectstore.gov.bc.ca"
AWS_S3_ENDPOINT: "nrs.objectstore.gov.bc.ca"
AWS_VIRTUAL_HOSTING: "FALSE"
AWS_EC2_METADATA_DISABLED: "true"
CPL_VSISTDIN_BUFFER_LIMIT: -1
OBJECTSTORE_BUCKET: ${{ secrets.OBJECTSTORE_BUCKET }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
jobs:
test:
runs-on: ubuntu-latest
name: test
container: ghcr.io/bcgov/harvest-restrictions:main
environment: production
services:
postgres:
image: postgis/postgis:16-3.4
env:
POSTGRES_PASSWORD: postgres
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
env:
DEBIAN_FRONTEND: noninteractive
steps:
- uses: actions/checkout@v4
- name: Install test dependencies
run: |
/venv/bin/python -m pip install -r requirements-dev.txt
- name: Run tests
run: |
/venv/bin/python -m pytest -v -rxXs
- name: Validate sources.json
run: |
/venv/bin/python download.py sources.json -t -v