Skip to content

Commit 9a136be

Browse files
committed
Make GitHub Actions validate the dynamic linking mode
1 parent f8f452b commit 9a136be

File tree

1 file changed

+40
-7
lines changed

1 file changed

+40
-7
lines changed

.github/workflows/main.yml

Lines changed: 40 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,14 @@ jobs:
99
matrix:
1010
compiler: [gcc, clang]
1111
architecture: [arm, riscv]
12+
linking: [static]
13+
include:
14+
- compiler: gcc
15+
architecture: arm
16+
linking: dynamic
17+
- compiler: clang
18+
architecture: arm
19+
linking: dynamic
1220
steps:
1321
- name: Checkout code
1422
uses: actions/checkout@v4
@@ -18,28 +26,53 @@ jobs:
1826
sudo apt-get install -q -y graphviz jq
1927
sudo apt-get install -q -y qemu-user
2028
sudo apt-get install -q -y build-essential
29+
sudo apt-get install -q -y gcc-arm-linux-gnueabi
30+
- name: Confirm linking mode
31+
id: confirm-mode
32+
run: |
33+
if [ "${{ matrix.linking }}" = "dymamic" ]; then
34+
echo "Use dynamic linking mode"
35+
echo "DYNLINK=1" >> "$GITHUB_OUTPUT"
36+
else
37+
echo "Use static linking mode"
38+
echo "DYNLINK=0" >> "$GITHUB_OUTPUT"
39+
fi
2140
- name: Build artifacts
2241
env:
2342
CC: ${{ matrix.compiler }}
2443
run: |
25-
make distclean config ARCH=${{ matrix.architecture }}
44+
make distclean config ARCH=${{ matrix.architecture }} \
45+
DYNLINK=${{ steps.confirm-mode.outputs.DYNLINK }}
2646
- name: IR regression tests
2747
run: |
28-
make check-snapshot || exit 1
48+
make check-snapshot DYNLINK=${{ steps.confirm-mode.outputs.DYNLINK }} || exit 1
2949
- name: Sanitizer-enabled stage 0 tests
3050
env:
3151
CC: ${{ matrix.compiler }}
3252
run: |
33-
make check-sanitizer || exit 1
53+
make check-sanitizer DYNLINK=${{ steps.confirm-mode.outputs.DYNLINK }} || exit 1
3454
- name: Unit tests
3555
run: |
36-
make check || exit 1
56+
make check DYNLINK=${{ steps.confirm-mode.outputs.DYNLINK }} || exit 1
3757
3858
host-arm:
3959
runs-on: ubuntu-24.04
60+
strategy:
61+
matrix:
62+
linking: [static, dynamic]
4063
steps:
4164
- name: Checkout code
4265
uses: actions/checkout@v4
66+
- name: Confirm linking mode
67+
id: confirm-mode
68+
run: |
69+
if [ "${{ matrix.linking }}" = "dymamic" ]; then
70+
echo "Use dynamic linking mode"
71+
echo "DYNLINK=1" >> "$GITHUB_OUTPUT"
72+
else
73+
echo "Use static linking mode"
74+
echo "DYNLINK=0" >> "$GITHUB_OUTPUT"
75+
fi
4376
- name: Build artifacts
4477
# The GitHub Action for non-x86 CPU
4578
# https://github.com/uraimo/run-on-arch-action
@@ -52,9 +85,9 @@ jobs:
5285
apt-get update -qq -y
5386
apt-get install -yqq build-essential
5487
run: |
55-
make config ARCH=arm
56-
make check-sanitizer || exit 1
57-
make check || exit 1
88+
make config ARCH=arm DYNLINK=${{ steps.confirm-mode.outputs.DYNLINK }}
89+
make check-sanitizer DYNLINK=${{ steps.confirm-mode.outputs.DYNLINK }} || exit 1
90+
make check DYNLINK=${{ steps.confirm-mode.outputs.DYNLINK }} || exit 1
5891
5992
coding-style:
6093
runs-on: ubuntu-24.04

0 commit comments

Comments
 (0)