-
Notifications
You must be signed in to change notification settings - Fork 37
76 lines (67 loc) · 2.13 KB
/
test.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
---
name: Tests
on:
pull_request:
branches:
- 'master'
- 'develop-1.9'
paths:
- '**'
- '!docs/**'
- '!*.rst'
- '!*.md'
- '!datacube_ows/__init__.py'
- '!.github/**'
- '.github/workflows/test.yml'
push:
branches:
- 'master'
paths:
- '**'
- '!docs/**'
- '!*.rst'
- '!*.md'
- '!datacube_ows/__init__.py'
- '!.github/**'
- '.github/workflows/test.yml'
env:
ORG: opendatacube
IMAGE: ows
jobs:
unit-integration-performance-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
# We build the stage 1 image, then run test on it
# These tests require extra files we don't want in
# the production image
# We build the stage 1 image, then run test on it
# These tests require extra files we don't want in
# the production image
- name: Build dev OWS image
run: |
docker build --build-arg ENVIRONMENT=test \
--tag ${ORG}/${IMAGE}:_builder \
.
- name: Test and lint dev OWS image
run: |
mkdir artifacts
docker run -e LOCAL_UID=$(id -u $USER) -e LOCAL_GID=$(id -g $USER) -v ${PWD}/artifacts:/mnt/artifacts ${ORG}/${IMAGE}:_builder /bin/sh -c "cd /code && ./check-code.sh"
mv ./artifacts/coverage.xml ./artifacts/coverage-unit.xml
- name: Dockerized Integration Pytest
run: |
export LOCAL_UID=$(id -u $USER)
export LOCAL_GID=$(id -g $USER)
export $(grep -v '^#' .env_simple | xargs)
docker compose -f docker-compose.yaml -f docker-compose.db.yaml up -d --wait --build
docker compose -f docker-compose.yaml -f docker-compose.db.yaml exec -T ows /bin/sh -c "cd /code && ./check-code-all.sh"
docker compose -f docker-compose.yaml -f docker-compose.db.yaml down
- name: Upload All coverage to Codecov
uses: codecov/codecov-action@v4
with:
directory: ./artifacts/
fail_ci_if_error: false
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}