Skip to content

Commit 65482c8

Browse files
committed
Merge pull request atomvm#1626 from petermm/rm-ubuntu-20
CI: Containerize ubuntu 20 Github is sunsetting the ubuntu20 runner on april 15th, so it needs to be in containers. actions/runner-images#11101 These changes are made under both the "Apache 2.0" and the "GNU Lesser General Public License 2.1 or later" license terms (dual license). SPDX-License-Identifier: Apache-2.0 OR LGPL-2.1-or-later
2 parents d024e6d + 1eea3e0 commit 65482c8

File tree

1 file changed

+38
-23
lines changed

1 file changed

+38
-23
lines changed

.github/workflows/build-and-test.yaml

Lines changed: 38 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ concurrency:
3434

3535
jobs:
3636
build-and-test:
37-
runs-on: ${{ matrix.os }}
37+
runs-on: ${{ matrix.os || 'ubuntu-24.04' }}
38+
container: ${{ matrix.container }}
3839
strategy:
3940

4041
fail-fast: false
@@ -56,17 +57,17 @@ jobs:
5657
- cc: "gcc-7"
5758
cxx: "g++-7"
5859
compiler_pkgs: "gcc-7 g++-7"
59-
os: "ubuntu-20.04"
60+
container: "ubuntu:20.04"
6061
otp: "27"
6162
- cc: "gcc-8"
6263
cxx: "g++-8"
6364
compiler_pkgs: "gcc-8 g++-8"
64-
os: "ubuntu-20.04"
65+
container: "ubuntu:20.04"
6566
otp: "27"
6667
- cc: "gcc-9"
6768
cxx: "g++-9"
6869
compiler_pkgs: "gcc-9 g++-9"
69-
os: "ubuntu-20.04"
70+
container: "ubuntu:20.04"
7071
# otp: all
7172
- cc: "gcc-10"
7273
cxx: "g++-10"
@@ -108,13 +109,13 @@ jobs:
108109
cxx: "clang++-10"
109110
compiler_pkgs: "clang-10"
110111
cmake_opts_other: "-DAVM_WARNINGS_ARE_ERRORS=ON"
111-
os: "ubuntu-20.04"
112+
container: "ubuntu:20.04"
112113
# otp: all
113114
- cc: "clang-11"
114115
cxx: "clang++-11"
115116
compiler_pkgs: "clang-11"
116117
cmake_opts_other: "-DAVM_WARNINGS_ARE_ERRORS=ON"
117-
os: "ubuntu-20.04"
118+
container: "ubuntu:20.04"
118119
otp: "27"
119120
- cc: "clang-12"
120121
cxx: "clang++-12"
@@ -169,33 +170,37 @@ jobs:
169170
elixir_version: "1.17"
170171

171172
# Old versions of OTP/Elixir
172-
- os: "ubuntu-20.04"
173+
- container: "ubuntu:20.04"
173174
cc: "cc"
174175
cxx: "c++"
175176
otp: "21"
176177
cflags: ""
177178
elixir_version: "1.7"
179+
compiler_pkgs: "g++"
178180

179-
- os: "ubuntu-20.04"
181+
- container: "ubuntu:20.04"
180182
cc: "cc"
181183
cxx: "c++"
182184
otp: "22"
183185
cflags: ""
184186
elixir_version: "1.8"
187+
compiler_pkgs: "g++"
185188

186-
- os: "ubuntu-20.04"
189+
- container: "ubuntu:20.04"
187190
cc: "cc"
188191
cxx: "c++"
189192
otp: "23"
190193
cflags: ""
191194
elixir_version: "1.11"
195+
compiler_pkgs: "g++"
192196

193-
- os: "ubuntu-22.04"
197+
- container: "ubuntu:20.04"
194198
cc: "cc"
195199
cxx: "c++"
196200
otp: "24"
197201
cflags: ""
198202
elixir_version: "1.14"
203+
compiler_pkgs: "g++"
199204

200205
# TODO: enable master again
201206
# master will not work until we don't adapt to atom table changes
@@ -207,12 +212,13 @@ jobs:
207212
# elixir_version: "main"
208213

209214
# Additional default compiler builds
210-
- os: "ubuntu-20.04"
215+
- container: "ubuntu:20.04"
211216
cc: "cc"
212217
cxx: "c++"
213218
otp: "27"
214219
cflags: ""
215220
elixir_version: "1.17"
221+
compiler_pkgs: "g++"
216222

217223
- os: "ubuntu-22.04"
218224
cc: "cc"
@@ -239,7 +245,7 @@ jobs:
239245
compiler_pkgs: "clang-18"
240246

241247
# Additional 32 bits build
242-
- os: "ubuntu-20.04"
248+
- container: "ubuntu:20.04"
243249
cc: "gcc-10"
244250
cxx: "g++-10"
245251
cflags: "-m32 -O3"
@@ -252,13 +258,30 @@ jobs:
252258
libc6-dbg:i386 zlib1g-dev:i386 libmbedtls-dev:i386"
253259

254260
env:
261+
ImageOS: ${{ matrix.container == 'ubuntu:20.04' && 'ubuntu20' || matrix.os == 'ubuntu-20.04' && 'ubuntu20' || matrix.os == 'ubuntu-22.04' && 'ubuntu22' || matrix.os == 'ubuntu-24.04' && 'ubuntu24' || 'ubuntu24' }}
255262
CC: ${{ matrix.cc }}
256263
CXX: ${{ matrix.cxx }}
257264
CFLAGS: ${{ matrix.cflags }}
258265
CXXFLAGS: ${{ matrix.cflags }}
266+
DEBIAN_FRONTEND: noninteractive
267+
TZ: "Etc/UTC"
259268

260269
steps:
261270
# Setup
271+
- name: "Install deps for containers"
272+
if: matrix.container != ''
273+
run: apt-get update && apt-get install -y --no-install-recommends sudo unzip git tzdata
274+
275+
- name: "Add i386 architecture"
276+
if: matrix.arch == 'i386'
277+
run: sudo dpkg --add-architecture i386
278+
279+
- name: "APT update"
280+
run: sudo apt update -y
281+
282+
- name: "Install deps"
283+
run: sudo apt install -y ${{ matrix.compiler_pkgs}} cmake gperf zlib1g-dev doxygen valgrind libmbedtls-dev
284+
262285
- name: "Checkout repo"
263286
uses: actions/checkout@v4
264287
with:
@@ -273,16 +296,6 @@ jobs:
273296
https://repo.hex.pm
274297
https://cdn.jsdelivr.net/hex
275298
276-
- name: "Add i386 architecture"
277-
if: matrix.arch == 'i386'
278-
run: sudo dpkg --add-architecture i386
279-
280-
- name: "APT update"
281-
run: sudo apt update -y
282-
283-
- name: "Install deps"
284-
run: sudo apt install -y ${{ matrix.compiler_pkgs}} cmake gperf zlib1g-dev doxygen valgrind libmbedtls-dev
285-
286299
# Builder info
287300
- name: "System info"
288301
run: |
@@ -393,10 +406,12 @@ jobs:
393406
working-directory: build
394407
run: |
395408
ulimit -c unlimited
396-
if command -v elixirc &> /dev/null
409+
if command -v elixirc >/dev/null 2>&1 && command -v elixir >/dev/null 2>&1
397410
then
398411
valgrind --error-exitcode=1 ./src/AtomVM ./tests/libs/exavmlib/Tests.avm
399412
./src/AtomVM ./tests/libs/exavmlib/Tests.avm
413+
else
414+
echo "Elixir not installed, skipping Elixir tests"
400415
fi
401416
402417
- name: "Install and smoke test"

0 commit comments

Comments
 (0)