-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (52 loc) · 1.88 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
name: CI
on: [push, pull_request]
jobs:
build:
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.11'
cache: pip
cache-dependency-path: '**/requirements*.txt'
- run: pip install -r requirements_dev.txt
- run: |
psql postgresql://postgres:postgres@localhost:${{ job.services.postgres.ports[5432] }}/postgres -f pelican/migrations/*.sql
psql postgresql://postgres:postgres@localhost:${{ job.services.postgres.ports[5432] }}/postgres -c "\copy exchange_rates (valid_on, rates) from 'pelican/static/exchange_rates_dump.csv' delimiter ',' csv header;"
- env:
DATABASE_URL: postgresql://postgres:postgres@localhost:${{ job.services.postgres.ports[5432] }}/postgres
# For requests.get() in pelican.util.codelists._get() (from unittest tests).
run: |
pytest -W error -W ignore::ResourceWarning -rs \
--cov contracting_process \
--cov dataset \
--cov manage \
--cov pelican \
--cov time_variance \
--cov workers
- env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: coveralls --service=github
services:
postgres:
image: postgres:12
env:
POSTGRES_PASSWORD: postgres
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432/tcp
rabbitmq:
image: rabbitmq:latest
options: >-
--health-cmd "rabbitmq-diagnostics -q check_running"
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5672/tcp