-
-
Notifications
You must be signed in to change notification settings - Fork 628
75 lines (66 loc) · 1.92 KB
/
docker-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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
name: Run Unit Tests
on:
push:
branches:
- master
- production
paths:
- '!README.md'
- '!webview/**'
- '!website/**'
- '!.github/workflows/build-webview.yaml'
- '!.github/workflows/build-balena-disk-image.yaml'
- '!docs/**'
pull_request:
branches:
- master
- production
paths:
- '**/**'
- '!README.md'
- '!webview/**'
- '!website/**'
- '!.github/workflows/build-webview.yaml'
- '!.github/workflows/build-balena-disk-image.yaml'
- '!docs/**'
workflow_call:
jobs:
run-tests:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Cache Docker layers
uses: actions/cache@v3
id: cache
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-x86
restore-keys: |
${{ runner.os }}-x86
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
- name: Build Containers
run: |
export SKIP_SERVER=1
export SKIP_WEBSOCKET=1
export SKIP_NGINX=1
export SKIP_VIEWER=1
export SKIP_WIFI_CONNECT=1
./bin/build_containers.sh
- name: Start the test container
run: |
docker compose -f docker-compose.test.yml up -d
- name: Run the tests inside the container
shell: 'script -q -e -c "bash {0}"'
run: |
docker compose -f docker-compose.test.yml exec anthias-test bash ./bin/prepare_test_environment.sh -s
docker compose -f docker-compose.test.yml exec anthias-test nosetests -v -a '!fixme'
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
- name: Stop the test container
run: |
docker compose -f docker-compose.test.yml down