-
Notifications
You must be signed in to change notification settings - Fork 106
141 lines (119 loc) · 3.8 KB
/
run-tests-with-beam.yaml
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
131
132
133
134
135
136
137
138
139
140
141
#
# Copyright 2022 Paul Guyot <[email protected]>
#
# SPDX-License-Identifier: Apache-2.0 OR LGPL-2.1-or-later
#
name: Run tests with BEAM
on:
push:
paths-ignore:
- 'src/platforms/esp32/**'
- 'src/platforms/stm32/**'
- 'doc/**'
- 'LICENSES/**'
pull_request:
paths-ignore:
- 'src/platforms/esp32/**'
- 'src/platforms/stm32/**'
- 'doc/**'
- 'LICENSES/**'
jobs:
run-tests:
runs-on: ${{ matrix.os }}
container: ${{ matrix.container }}
strategy:
fail-fast: false
matrix:
include:
- os: "ubuntu-20.04"
test_erlang_opts: "-s prime_smp"
otp: "21"
- os: "ubuntu-20.04"
test_erlang_opts: "-s prime_smp"
otp: "22"
- os: "ubuntu-20.04"
test_erlang_opts: "-s prime_smp"
otp: "23"
- os: "ubuntu-22.04"
test_erlang_opts: "-s prime_smp"
otp: "24"
- os: "ubuntu-22.04"
test_erlang_opts: "-s prime_smp"
otp: "25"
- os: "ubuntu-22.04"
test_erlang_opts: "-s prime_smp"
otp: "26"
container: erlang:26
- os: "macos-latest"
otp: "23"
path_prefix: "/usr/local/opt/erlang@23/bin:"
cmake_opts: "-DOPENSSL_ROOT_DIR=/usr/local/opt/openssl"
- os: "macos-latest"
otp: "24"
path_prefix: "/usr/local/opt/erlang@24/bin:"
cmake_opts: "-DOPENSSL_ROOT_DIR=/usr/local/opt/openssl"
- os: "macos-latest"
otp: "25"
path_prefix: "/usr/local/opt/erlang@25/bin:"
cmake_opts: "-DOPENSSL_ROOT_DIR=/usr/local/opt/openssl"
steps:
# Setup
- name: "Checkout repo"
uses: actions/checkout@v3
with:
submodules: 'recursive'
- uses: erlef/setup-beam@v1
if: runner.os == 'Linux' && matrix.container == ''
with:
otp-version: ${{ matrix.otp }}
- name: "Install deps (Linux)"
if: runner.os == 'Linux' && matrix.container == ''
run: |
sudo apt update -y
sudo apt install -y cmake gperf zlib1g-dev ninja-build
- name: "Install deps (container)"
if: runner.os == 'Linux' && matrix.container != ''
run: |
apt update -y
apt install -y cmake gperf zlib1g-dev ninja-build
- name: "Install deps (macOS)"
if: runner.os == 'macOS'
run: brew install gperf erlang@${{ matrix.otp }} ninja
# Build
- name: "Build: create build dir"
run: mkdir build
- uses: actions/cache@v3
id: cache
with:
path: 'build/tests/**/*.beam'
key: ${{ matrix.otp }}-${{ hashFiles('**/run-tests-with-beam.yaml', 'tests/**/*.erl') }}
- name: "Build: run cmake"
working-directory: build
run: |
export PATH="${{ matrix.path_prefix }}$PATH"
cmake -G Ninja ${{ matrix.cmake_opts }} ..
- name: "Touch files to benefit from cache"
working-directory: build
run: |
# git clone will use more recent timestamps than cached beam files
# touch them so we can benefit from the cache and avoid costly beam file rebuild.
find . -name '*.beam' -exec touch {} \;
- name: "Build: run ninja"
working-directory: build
run: |
export PATH="${{ matrix.path_prefix }}$PATH"
ninja
# Test
- name: "Test: test-erlang with BEAM"
timeout-minutes: 10
working-directory: build
run: |
export PATH="${{ matrix.path_prefix }}$PATH"
./tests/test-erlang -b ${{ matrix.test_erlang_opts }}
# Test
- name: "Test: estdlib/ with BEAM"
timeout-minutes: 10
working-directory: build
run: |
export PATH="${{ matrix.path_prefix }}$PATH"
erl -pa tests/libs/estdlib/ -pa tests/libs/estdlib/beams/ -pa libs/etest/src/beams -s tests -s init stop -noshell