-
Notifications
You must be signed in to change notification settings - Fork 13
130 lines (106 loc) · 3.06 KB
/
tests.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
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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
name: Tests
on:
pull_request:
paths:
- 'src/satellite/**'
- 'src/orbiter/**'
- 'src/console/**'
- 'src/observatory/**'
- 'src/mission_control/**'
- 'src/libs/**'
- 'src/tests/**'
- 'rust-toolchain.toml'
- 'Cargo.toml'
- 'docker/**'
jobs:
docker-build-base:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build Base Docker Image
uses: ./.github/actions/docker-build-base
docker-build:
runs-on: ubuntu-latest
needs: docker-build-base
strategy:
matrix:
include:
- name: satellite
wasm: satellite.wasm.gz
target: scratch_satellite
- name: orbiter
wasm: orbiter.wasm.gz
target: scratch_orbiter
- name: console
wasm: console.wasm.gz
target: scratch_console
- name: observatory
wasm: observatory.wasm.gz
target: scratch_observatory
- name: mission_control
wasm: mission_control.wasm.gz
target: scratch_mission_control
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up docker buildx
uses: docker/setup-buildx-action@v3
- name: Build ${{ matrix.name }}
uses: docker/build-push-action@v5
with:
file: Dockerfile
cache-from: type=gha,scope=cached-stage
# Exports the artefacts from the final stage
outputs: ./out
target: ${{ matrix.target }}
- run: mv out/${{ matrix.wasm }} ${{ matrix.wasm }}
- name: Upload ${{ matrix.name }}
uses: actions/upload-artifact@v4
with:
# name is the name used to display and retrieve the artifact
name: ${{ matrix.wasm }}
# path is the name used as the file to upload and the name of the
# downloaded file
path: ./${{ matrix.wasm }}
tests:
runs-on: ubuntu-latest
needs: docker-build
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Prepare
uses: ./.github/actions/prepare
- name: Download satellite.wasm.gz
uses: actions/download-artifact@v4
with:
name: satellite.wasm.gz
path: .
- name: Download orbiter.wasm.gz
uses: actions/download-artifact@v4
with:
name: orbiter.wasm.gz
path: .
- name: Download console.wasm.gz
uses: actions/download-artifact@v4
with:
name: console.wasm.gz
path: .
- name: Download observatory.wasm.gz
uses: actions/download-artifact@v4
with:
name: observatory.wasm.gz
path: .
- name: Download mission_control.wasm.gz
uses: actions/download-artifact@v4
with:
name: mission_control.wasm.gz
path: .
- name: Tests
run: npm run test
may-merge:
needs: ['tests']
runs-on: ubuntu-latest
steps:
- name: Cleared for merging
run: echo OK