-
Notifications
You must be signed in to change notification settings - Fork 1
57 lines (45 loc) · 1.52 KB
/
build_and_test.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
name: Test
on:
push:
pull_request:
jobs:
docker:
name: Build and test
timeout-minutes: 15
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.9]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Start containers
run: |
mv .env.sample .env
docker-compose -f "docker-compose.production.yaml" up -d --build --quiet-pull
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install ERDDAP harvester and db loader
run: pip install -q ./harvester ./db-loader
- name: Run ERDDAP harvester on sample dataset
run: python -m cde_harvester --urls https://data.cioospacific.ca/erddap/ --dataset_ids DFO_MEDS_BUOYS --folder erddap_harvest
- name: Load harvested data into the DB
run: python -m cde_db_loader --folder erddap_harvest
- name: Install node
uses: actions/setup-node@v3
with:
node-version: 16.x
- name: Install dependencies
working-directory: ./test
run: npm ci --quiet
- name: Test API endpoints
working-directory: ./test
run: node test_api_endpoints.js
- name: Test frontend loads without errors
working-directory: ./test
run: node frontend_loads_without_errors.js
- name: Stop containers
if: always()
run: docker-compose -f "docker-compose.production.yaml" down