@@ -6,9 +6,16 @@ on: [push, pull_request]
6
6
# - "!README.md" <-- don't rebuild on doc change
7
7
8
8
jobs :
9
- build-gcc :
9
+ build :
10
10
runs-on : ubuntu-20.04
11
- container : khancyr/ardupilot-dev-base:latest
11
+ container : khancyr/ardupilot-dev-${{ matrix.toolchain }}:latest
12
+ strategy :
13
+ fail-fast : false # don't cancel if a job from the matrix fails
14
+ matrix :
15
+ toolchain : [
16
+ base, # GCC
17
+ clang,
18
+ ]
12
19
steps :
13
20
# git checkout the PR
14
21
- uses : actions/checkout@v2
24
31
uses : actions/cache@v2
25
32
with :
26
33
path : ~/.ccache
27
- key : ${{github.workflow}}-ccache-${{steps.ccache_cache_timestamp.outputs.timestamp}}
28
- restore-keys : ${{github.workflow}}-ccache- # restore ccache from either previous build on this branch or on master
34
+ key : ${{github.workflow}}-ccache-${{ matrix.toolchain }}-${{ steps.ccache_cache_timestamp.outputs.timestamp}}
35
+ restore-keys : ${{github.workflow}}-ccache-${{ matrix.toolchain }}- # restore ccache from either previous build on this branch or on master
29
36
- name : setup ccache
30
37
run : |
31
38
mkdir -p ~/.ccache
@@ -35,57 +42,21 @@ jobs:
35
42
echo "max_size = 400M" >> ~/.ccache/ccache.conf
36
43
ccache -s
37
44
ccache -z
38
- - name : build copter
45
+ - name : build copter ${{ matrix.toolchain }}
39
46
shell : bash
40
47
run : |
48
+ if [[ ${{ matrix.toolchain }} = "clang" ]]; then
49
+ export CC=clang-7
50
+ export CXX=clang++-7
51
+ fi
41
52
PATH="/github/home/.local/bin:$PATH"
42
53
./waf configure --board sitl
43
54
./waf build --target bin/arducopter
44
55
ccache -s
45
56
ccache -z
46
57
47
- build-clang :
48
- runs-on : ubuntu-20.04
49
- container : khancyr/ardupilot-dev-clang:latest
50
- steps :
51
- # git checkout the PR
52
- - uses : actions/checkout@v2
53
- with :
54
- submodules : ' recursive'
55
- # Put ccache into github cache for faster build
56
- - name : Prepare ccache timestamp
57
- id : ccache_cache_timestamp
58
- run : |
59
- NOW=$(date -u +"%F-%T")
60
- echo "::set-output name=timestamp::${NOW}"
61
- - name : ccache cache files
62
- uses : actions/cache@v2
63
- with :
64
- path : ~/.ccache
65
- key : ${{github.workflow}}-ccache-clang-${{steps.ccache_cache_timestamp.outputs.timestamp}}
66
- restore-keys : ${{github.workflow}}-ccache-clang- # restore ccache from either previous build on this branch or on master
67
- - name : setup ccache
68
- run : |
69
- mkdir -p ~/.ccache
70
- echo "base_dir = ${GITHUB_WORKSPACE}" > ~/.ccache/ccache.conf
71
- echo "compression = true" >> ~/.ccache/ccache.conf
72
- echo "compression_level = 6" >> ~/.ccache/ccache.conf
73
- echo "max_size = 400M" >> ~/.ccache/ccache.conf
74
- ccache -s
75
- ccache -z
76
- - name : build copter
77
- shell : bash
78
- run : |
79
- export CC=clang-7
80
- export CXX=clang++-7
81
- PATH="/github/home/.local/bin:$PATH"
82
- ./waf configure --board sitl --board sitl
83
- ./waf build --target bin/arducopter
84
- ccache -s
85
- ccache -z
86
-
87
58
autotest :
88
- needs : build-gcc # don't try to launch the tests matrix if it doesn't build first, profit from caching for fast build
59
+ needs : build # don't try to launch the tests matrix if it doesn't build first, profit from caching for fast build
89
60
runs-on : ubuntu-20.04
90
61
container : khancyr/ardupilot-dev-base:latest
91
62
strategy :
116
87
uses : actions/cache@v2
117
88
with :
118
89
path : ~/.ccache
119
- key : ${{github.workflow}}-ccache-${{steps.ccache_cache_timestamp.outputs.timestamp}}
120
- restore-keys : ${{github.workflow}}-ccache- # restore ccache from either previous build on this branch or on master
90
+ key : ${{github.workflow}}-ccache-base- ${{steps.ccache_cache_timestamp.outputs.timestamp}}
91
+ restore-keys : ${{github.workflow}}-ccache-base- # restore ccache from either previous build on this branch or on master
121
92
- name : setup ccache
122
93
run : |
123
94
mkdir -p ~/.ccache
@@ -151,7 +122,7 @@ jobs:
151
122
152
123
153
124
build-gcc-heli :
154
- needs : build-gcc # don't try to launch the tests matrix if it doesn't build first, profit from caching for fast build
125
+ needs : build # don't try to launch the tests matrix if it doesn't build first, profit from caching for fast build
155
126
runs-on : ubuntu-20.04
156
127
container : khancyr/ardupilot-dev-base:latest
157
128
steps :
@@ -169,8 +140,8 @@ jobs:
169
140
uses : actions/cache@v2
170
141
with :
171
142
path : ~/.ccache
172
- key : ${{github.workflow}}-ccache-${{steps.ccache_cache_timestamp.outputs.timestamp}}
173
- restore-keys : ${{github.workflow}}-ccache- # restore ccache from either previous build on this branch or on master
143
+ key : ${{github.workflow}}-ccache-base- ${{steps.ccache_cache_timestamp.outputs.timestamp}}
144
+ restore-keys : ${{github.workflow}}-ccache-base- # restore ccache from either previous build on this branch or on master
174
145
- name : setup ccache
175
146
run : |
176
147
mkdir -p ~/.ccache
@@ -215,8 +186,8 @@ jobs:
215
186
uses : actions/cache@v2
216
187
with :
217
188
path : ~/.ccache
218
- key : ${{github.workflow}}-ccache-${{steps.ccache_cache_timestamp.outputs.timestamp}}
219
- restore-keys : ${{github.workflow}}-ccache- # restore ccache from either previous build on this branch or on master
189
+ key : ${{github.workflow}}-ccache-base- ${{steps.ccache_cache_timestamp.outputs.timestamp}}
190
+ restore-keys : ${{github.workflow}}-ccache-base- # restore ccache from either previous build on this branch or on master
220
191
- name : setup ccache
221
192
run : |
222
193
mkdir -p ~/.ccache
0 commit comments