Skip to content

Commit f1d0dc4

Browse files
committed
Merge pull request #1214 from pguyot/w26/workaround-setup-beam-failures
Work around recent setup-beam action failures * Use Erlang Docker container where possible * Add hexpm mirrors to remaining setup-beam invocations * Bump OTP version to 17 and Elixir to 1.17 * Split check formatting build in three jobs with different containers * Use elixir 1.17.1 container for mix format and reformat files accordingly 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 10a8f42 + 85ca4ce commit f1d0dc4

13 files changed

+75
-115
lines changed

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

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -32,38 +32,24 @@ concurrency:
3232
group: ${{ github.workflow }}-${{ github.ref != 'refs/heads/main' && github.ref || github.run_id }}
3333
cancel-in-progress: true
3434

35-
env:
36-
otp_version: 27
37-
elixir_version: 1.17
38-
3935
jobs:
4036
compile_tests:
4137
runs-on: ubuntu-24.04
38+
container: erlang:27
4239
steps:
4340
- name: Checkout repo
4441
uses: actions/checkout@v4
4542

46-
- uses: erlef/setup-beam@v1
47-
with:
48-
otp-version: ${{ env.otp_version }}
49-
elixir-version: ${{ env.elixir_version }}
50-
51-
- name: apt update
52-
run: sudo apt update
53-
5443
- name: Install required packages
55-
run: sudo apt install -y gperf
44+
run: apt update && apt install -y gperf zlib1g-dev cmake ninja-build
5645

5746
- name: Compile test modules
5847
run: |
5948
set -e
6049
mkdir build_tests
6150
cd build_tests
62-
cmake ..
63-
make erlang_test_modules
64-
make test_estdlib
65-
make test_eavmlib
66-
make test_alisp
51+
cmake .. -G Ninja -DAVM_WARNINGS_ARE_ERRORS=ON
52+
ninja erlang_test_modules test_estdlib test_eavmlib test_alisp
6753
6854
- name: Upload test modules
6955
uses: actions/upload-artifact@v4

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

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,12 +197,12 @@ jobs:
197197
cflags: ""
198198
elixir_version: "1.14"
199199

200-
# master version of OTP/Elixir
200+
# master/main version of OTP/Elixir
201201
- os: "ubuntu-24.04"
202202
cc: "cc"
203203
cxx: "c++"
204204
otp: "master"
205-
elixir_version: "master"
205+
elixir_version: "main"
206206

207207
# Additional default compiler builds
208208
- os: "ubuntu-20.04"
@@ -266,6 +266,10 @@ jobs:
266266
with:
267267
otp-version: ${{ matrix.otp }}
268268
elixir-version: ${{ matrix.elixir_version }}
269+
hexpm-mirrors: |
270+
https://builds.hex.pm
271+
https://repo.hex.pm
272+
https://cdn.jsdelivr.net/hex
269273
270274
- name: "Add i386 architecture"
271275
if: matrix.arch == 'i386'

.github/workflows/build-docs.yaml

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -46,15 +46,16 @@ jobs:
4646
build:
4747
# The type of runner that the job will run on
4848
runs-on: ubuntu-latest
49+
container: erlang:27
4950

5051
# Steps represent a sequence of tasks that will be executed as part of the job
5152
steps:
5253
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
5354

5455
- name: Install Deps
5556
run: |
56-
sudo apt update -y
57-
DEBIAN_FRONTEND=noninteractive sudo apt install -y git cmake doxygen graphviz python3-pip python3-virtualenv python3-setuptools python3-stemmer wget
57+
apt update -y
58+
DEBIAN_FRONTEND=noninteractive apt install -y git cmake doxygen graphviz python3-pip python3-virtualenv python3.11-venv python3-setuptools python3-stemmer wget
5859
5960
- uses: actions/cache@v4
6061
id: sphinx-cache
@@ -76,18 +77,6 @@ jobs:
7677
python3 -m pip install breathe
7778
python3 -m pip install pygments
7879
79-
- uses: erlef/setup-beam@v1
80-
with:
81-
otp-version: "25"
82-
elixir-version: "1.15"
83-
84-
- name: Install rebar3
85-
working-directory: /tmp
86-
run: |
87-
wget https://s3.amazonaws.com/rebar3/rebar3 && chmod +x rebar3
88-
./rebar3 local install
89-
echo "/home/runner/.cache/rebar3/bin" >> ${GITHUB_PATH}
90-
9180
- uses: actions/checkout@v4
9281
with:
9382
repository: ${{ vars.GITHUB_REPOSITORY }}
@@ -97,6 +86,7 @@ jobs:
9786
shell: bash
9887
run: |
9988
. /home/runner/python-env/sphinx/bin/activate
89+
git config --global --add safe.directory ${PWD}
10090
mkdir build
10191
cd build
10292
cmake ..

.github/workflows/build-libraries.yaml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ permissions:
1616

1717
jobs:
1818
build-libraries:
19-
runs-on: "ubuntu-22.04"
19+
runs-on: "ubuntu-24.04"
20+
container: erlang:27
2021
strategy:
2122
fail-fast: false
2223

@@ -26,11 +27,6 @@ jobs:
2627
with:
2728
submodules: 'recursive'
2829

29-
- uses: erlef/setup-beam@v1
30-
with:
31-
otp-version: "24"
32-
elixir-version: "1.11"
33-
3430
- name: "APT update"
3531
run: sudo apt update -y
3632

.github/workflows/build-linux-artifacts.yaml

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -14,38 +14,27 @@ on:
1414
permissions:
1515
contents: write
1616

17-
env:
18-
otp_version: 24
19-
elixir_version: 1.14
20-
2117
jobs:
2218
compile_tests:
23-
runs-on: ubuntu-22.04
19+
runs-on: ubuntu-24.04
20+
container: erlang:27
2421
steps:
2522
- name: Checkout repo
2623
uses: actions/checkout@v4
2724

28-
- uses: erlef/setup-beam@v1
29-
with:
30-
otp-version: ${{ env.otp_version }}
31-
elixir-version: ${{ env.elixir_version }}
32-
3325
- name: apt update
3426
run: sudo apt update
3527

3628
- name: Install required packages
37-
run: sudo apt install -y gperf
29+
run: sudo apt install -y cmake gperf zlib1g-dev ninja-build
3830

3931
- name: Compile test modules
4032
run: |
4133
set -e
4234
mkdir build_tests
4335
cd build_tests
44-
cmake ..
45-
make erlang_test_modules
46-
make test_estdlib
47-
make test_eavmlib
48-
make test_alisp
36+
cmake .. -G Ninja -DAVM_WARNINGS_ARE_ERRORS=ON
37+
ninja erlang_test_modules test_estdlib test_eavmlib test_alisp
4938
5039
- name: Upload test modules
5140
uses: actions/upload-artifact@v4

.github/workflows/check-formatting.yaml

Lines changed: 21 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -27,19 +27,14 @@ concurrency:
2727
cancel-in-progress: true
2828

2929
jobs:
30-
clang-format-check:
31-
runs-on: ubuntu-20.04
30+
clang-format-prettier-check:
31+
runs-on: ubuntu-24.04
3232
steps:
3333
- uses: actions/checkout@v4
3434

35-
- uses: erlef/setup-beam@v1
36-
with:
37-
otp-version: 24.3
38-
elixir-version: 1.12
39-
4035
- name: "Install run-clang-format"
4136
run: |
42-
wget -q -O - https://apt.llvm.org/llvm-snapshot.gpg.key|sudo apt-key add -
37+
wget -q -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
4338
echo "deb http://apt.llvm.org/focal/ llvm-toolchain-focal-16 main" | sudo tee -a /etc/apt/sources.list
4439
echo "deb-src http://apt.llvm.org/focal/ llvm-toolchain-focal-16 main" | sudo tee -a /etc/apt/sources.list
4540
sudo apt-get update
@@ -51,8 +46,19 @@ jobs:
5146
run: |
5247
./run-clang-format --style=file --clang-format-executable=clang-format-16 -r src/ tests/
5348
54-
- name: "Check formatting with Erlang fmt"
49+
- name: "Check formatting with prettier"
5550
if: success() || failure()
51+
run: |
52+
npm install prettier
53+
find ../src/platforms/emscripten/ ../examples/emscripten/ -name "*.js" -o -name "*.html" | xargs npx prettier -c
54+
55+
erlfmt-check:
56+
runs-on: ubuntu-24.04
57+
container: erlang:27
58+
steps:
59+
- uses: actions/checkout@v4
60+
61+
- name: "Check formatting with Erlang fmt"
5662
run: |
5763
cd ..
5864
git clone --depth 1 -b v1.1.0 https://github.com/WhatsApp/erlfmt.git
@@ -61,14 +67,13 @@ jobs:
6167
cd ../AtomVM
6268
find . -name *.erl | xargs ../erlfmt/_build/release/bin/erlfmt -c
6369
70+
mix-format-check:
71+
runs-on: ubuntu-24.04
72+
container: elixir:1.17.1
73+
steps:
74+
- uses: actions/checkout@v4
75+
6476
- name: "Check formatting with Elixir mix format"
65-
if: success() || failure()
6677
run: |
6778
cd libs/exavmlib/
6879
mix format --check-formatted
69-
70-
- name: "Check formatting with prettier"
71-
if: success() || failure()
72-
run: |
73-
npm install prettier
74-
find ../src/platforms/emscripten/ ../examples/emscripten/ -name "*.js" -o -name "*.html" | xargs npx prettier -c

.github/workflows/esp32-mkimage.yaml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ jobs:
3939
cc: ["clang-10"]
4040
cxx: ["clang++-10"]
4141
cflags: ["-O3"]
42-
otp: ["24"]
43-
elixir_version: ["1.11"]
42+
otp: ["27"]
43+
elixir_version: ["1.17"]
4444
compiler_pkgs: ["clang-10"]
4545
soc: ["esp32", "esp32c2", "esp32c3", "esp32s2", "esp32s3", "esp32c6", "esp32h2"]
4646

@@ -59,6 +59,10 @@ jobs:
5959
with:
6060
otp-version: ${{ matrix.otp }}
6161
elixir-version: ${{ matrix.elixir_version }}
62+
hexpm-mirrors: |
63+
https://builds.hex.pm
64+
https://repo.hex.pm
65+
https://cdn.jsdelivr.net/hex
6266
6367
- name: "APT update"
6468
run: apt update -y

.github/workflows/publish-docs.yaml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,12 @@ jobs:
6969
7070
- uses: erlef/setup-beam@v1
7171
with:
72-
otp-version: "25"
73-
elixir-version: "1.15"
72+
otp-version: "27"
73+
elixir-version: "1.17"
74+
hexpm-mirrors: |
75+
https://builds.hex.pm
76+
https://repo.hex.pm
77+
https://cdn.jsdelivr.net/hex
7478
7579
- name: Install rebar3
7680
working-directory: /tmp

.github/workflows/run-tests-with-beam.yaml

Lines changed: 9 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -40,25 +40,25 @@ jobs:
4040
fail-fast: false
4141
matrix:
4242
include:
43-
- os: "ubuntu-20.04"
43+
- os: "ubuntu-24.04"
4444
test_erlang_opts: "-s prime_smp"
45-
otp: "21"
45+
container: erlang:21
4646

47-
- os: "ubuntu-20.04"
47+
- os: "ubuntu-24.04"
4848
test_erlang_opts: "-s prime_smp"
49-
otp: "22"
49+
container: erlang:22
5050

51-
- os: "ubuntu-20.04"
51+
- os: "ubuntu-24.04"
5252
test_erlang_opts: "-s prime_smp"
53-
otp: "23"
53+
container: erlang:23
5454

5555
- os: "ubuntu-24.04"
5656
test_erlang_opts: "-s prime_smp"
57-
otp: "24"
57+
container: erlang:24
5858

5959
- os: "ubuntu-24.04"
6060
test_erlang_opts: "-s prime_smp"
61-
otp: "25"
61+
container: erlang:25
6262

6363
- os: "ubuntu-24.04"
6464
test_erlang_opts: "-s prime_smp"
@@ -89,19 +89,8 @@ jobs:
8989
with:
9090
submodules: 'recursive'
9191

92-
- uses: erlef/setup-beam@v1
93-
if: runner.os == 'Linux' && matrix.container == ''
94-
with:
95-
otp-version: ${{ matrix.otp }}
96-
97-
- name: "Install deps (Linux)"
98-
if: runner.os == 'Linux' && matrix.container == ''
99-
run: |
100-
sudo apt update -y
101-
sudo apt install -y cmake gperf zlib1g-dev ninja-build
102-
10392
- name: "Install deps (container)"
104-
if: runner.os == 'Linux' && matrix.container != ''
93+
if: runner.os == 'Linux'
10594
run: |
10695
apt update -y
10796
apt install -y cmake gperf zlib1g-dev ninja-build

.github/workflows/stm32-build.yaml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ concurrency:
2626

2727
jobs:
2828
stm32:
29-
runs-on: ubuntu-22.04
29+
runs-on: ubuntu-24.04
3030
steps:
3131
- uses: actions/cache@v4
3232
id: builddeps-cache
@@ -38,7 +38,11 @@ jobs:
3838

3939
- uses: erlef/setup-beam@v1
4040
with:
41-
otp-version: "26"
41+
otp-version: "27"
42+
hexpm-mirrors: |
43+
https://builds.hex.pm
44+
https://repo.hex.pm
45+
https://cdn.jsdelivr.net/hex
4246
4347
- name: Install arm-embedded toolchain
4448
if: ${{ steps.builddeps-cache.outputs.cache-hit != 'true' }}

0 commit comments

Comments
 (0)