-
Notifications
You must be signed in to change notification settings - Fork 0
107 lines (92 loc) · 3.35 KB
/
tests.yml
File metadata and controls
107 lines (92 loc) · 3.35 KB
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
name: Run tests
on:
push:
branches:
- master
- develop
pull_request:
branches:
- master
- develop
env:
AWS_DEFAULT_REGION: ap-southeast-2
jobs:
tests:
name: tests
runs-on: ${{ matrix.os }}
if: "!contains(github.event.head_commit.message, 'nogha') && !contains(github.event.head_commit.message, 'notests')"
strategy:
matrix:
os: ["ubuntu-20.04"]
steps:
- uses: actions/checkout@v3
- name: Init runner
run: .github/workflows/scripts/runner-init.sh
- name: Cache build image
uses: actions/cache@v3
continue-on-error: false
with:
path: image-build.tgz
key: ansilo-build-${{ runner.os }}-${{ hashFiles('.github/workflows/docker/build.ubi9.Dockerfile', '.github/workflows/scripts/build-build-image.sh') }}
- name: Cache maven registry
uses: actions/cache@v3
continue-on-error: false
with:
path: |
~/.m2
key: ansilo-test-package-${{ runner.os }}-${{ hashFiles('**/pom.xml') }}
- name: Build base image
run: .github/workflows/scripts/build-build-image.sh
- uses: Swatinem/rust-cache@v2
- name: Create volume dirs
run: .github/workflows/scripts/volumes.sh
- name: Cargo build
run: |
docker run \
-v $HOME/.cargo:/home/build/.cargo \
-v $HOME/.m2:/home/build/.m2 \
-v $HOME/.ecs:/home/build/.ecs \
-v $HOME/.pgx:/home/build/.pgx \
-v $PWD:/build/ \
-w /build/ \
ansilo-build /build/.github/workflows/scripts/test-build.sh
- name: Test setup
run: |
docker run \
-e AWS_ACCESS_KEY_ID=${{ secrets.TESTS_AWS_ACCESS_KEY_ID }} \
-e AWS_SECRET_ACCESS_KEY=${{ secrets.TESTS_AWS_SECRET_ACCESS_KEY }} \
-e GHA_RUN_ID=${{ github.run_id }} \
-v $HOME/.cargo:/home/build/.cargo \
-v $HOME/.m2:/home/build/.m2 \
-v $HOME/.ecs:/home/build/.ecs \
-v $HOME/.pgx:/home/build/.pgx \
-v $PWD:/build/ \
-w /build/ \
ansilo-build /build/.github/workflows/scripts/test-setup.sh
- name: Run tests
run: |
docker run \
-e AWS_ACCESS_KEY_ID=${{ secrets.TESTS_AWS_ACCESS_KEY_ID }} \
-e AWS_SECRET_ACCESS_KEY=${{ secrets.TESTS_AWS_SECRET_ACCESS_KEY }} \
-e GHA_RUN_ID=${{ github.run_id }} \
-v $HOME/.cargo:/home/build/.cargo \
-v $HOME/.m2:/home/build/.m2 \
-v $HOME/.ecs:/home/build/.ecs \
-v $HOME/.pgx:/home/build/.pgx \
-v $PWD:/build/ \
-w /build/ \
ansilo-build /build/.github/workflows/scripts/test.sh
- name: Post tests teardown
if: always()
run: |
docker run \
-e AWS_ACCESS_KEY_ID=${{ secrets.TESTS_AWS_ACCESS_KEY_ID }} \
-e AWS_SECRET_ACCESS_KEY=${{ secrets.TESTS_AWS_SECRET_ACCESS_KEY }} \
-e GHA_RUN_ID=${{ github.run_id }} \
-v $HOME/.cargo:/home/build/.cargo \
-v $HOME/.m2:/home/build/.m2 \
-v $HOME/.ecs:/home/build/.ecs \
-v $HOME/.pgx:/home/build/.pgx \
-v $PWD:/build/ \
-w /build/ \
ansilo-build /build/.github/workflows/scripts/test-teardown.sh