forked from observatorycontrolsystem/science-archive
-
Notifications
You must be signed in to change notification settings - Fork 0
58 lines (56 loc) · 1.59 KB
/
build.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
name: Build
on:
# Run this workflow for pushes on all branches
push:
branches:
- '**'
# Run this workflow when a tag or branch is created
create:
# Run this workflow for pull requests
pull_request:
jobs:
run_tests:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10"]
services:
postgres:
image: postgis/postgis:9.6-2.5
env:
POSTGRES_USER: postgres
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
ports:
- 5432:5432
steps:
- name: Check out repository
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 and setup
run: |
sudo apt-get -y update
sudo apt-get install gdal-bin
python -m pip install --upgrade pip
pip install -r .poetry-version
pip install -r <(poetry export --with dev)
- name: Run tests
run: poetry run coverage run manage.py test --settings=test_settings
env:
DB_USER: postgres
DB_PASS: postgres
DB_HOST: 127.0.0.1
DB_HOST_READER: 127.0.0.1
DB_PORT: 5432
- name: Generate and send coveralls report
run: poetry run coveralls --service=github
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}