-
-
Notifications
You must be signed in to change notification settings - Fork 491
116 lines (109 loc) · 4.09 KB
/
ci.yml
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
name: "CI"
on:
pull_request:
push:
jobs:
shellcheck:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: shellcheck tests/*.sh
nix:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v30
- run: nix-build -A hydraJobs.release
ubuntu:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: get toolchain version
run: |
c++ --version
ld --version
autoconf --version
- run: |
./bootstrap.sh
mkdir build && cd build
../configure --with-asan --with-ubsan
make -j$(nproc) check
distro_matrix:
name: build distribution matrix
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.matrix.outputs.matrix }}
steps:
- id: matrix
name: build matrix
shell: python
run: |
import os
import json
reduced = [
("almalinux:8", ("x86_64", "aarch64", "ppc64le", "s390x")),
("almalinux:9", ("x86_64", "aarch64", "ppc64le", "s390x")),
("centos:7", ("x86_64", "i686", "aarch64", "ppc64le", "s390x")),
("debian:10", ("x86_64", "i686", "aarch64", "armv7l")),
("debian:11", ("x86_64", "i686", "aarch64", "armv7l")),
("debian:12", ("x86_64", "i686", "aarch64", "armv7l", "ppc64le", "s390x")),
("ubuntu:18.04", ("x86_64", "i686", "aarch64", "armv7l", "ppc64le", "s390x")),
("ubuntu:20.04", ("x86_64", "aarch64", "armv7l", "ppc64le", "s390x", "riscv64")),
("ubuntu:22.04", ("x86_64", "aarch64", "armv7l", "ppc64le", "s390x", "riscv64")),
("ubuntu:24.04", ("x86_64", "aarch64", "armv7l", "ppc64le", "s390x", "riscv64")),
]
expanded = [{"distro": distro, "platform": platform} for distro, platforms in reduced for platform in platforms]
print(json.dumps(expanded, indent=2))
with open(os.environ["GITHUB_OUTPUT"], "at") as f:
f.write(f"matrix={json.dumps(expanded)}")
distro_check:
needs: distro_matrix
name: ${{ matrix.distro }} ${{ matrix.platform }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include: ${{ fromJson(needs.distro_matrix.outputs.matrix) }}
steps:
- uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- run: |
# ${{ matrix.distro }} ${{ matrix.platform }} tests
cat <<EOF > build.sh
set -e
set -x
case "${{ matrix.distro }}" in
ubuntu:18.04)
apt-get update
apt-get -y install software-properties-common
add-apt-repository -y ppa:ubuntu-toolchain-r/test
apt-get update
apt-get -y install automake g++-11 make
update-alternatives --install /usr/bin/c++ c++ $(which g++-11) 100
update-alternatives --install /usr/bin/cc cc $(which gcc-11) 100
;;
ubuntu*|debian*) apt-get update && apt-get -y install automake g++ make;;
esac
c++ --version
ld --version
autoconf --version
./bootstrap.sh
mkdir build && cd build
../configure
make -j$(nproc) check || (cat tests/test-suite.log; exit 1)
EOF
case "${{ matrix.platform }}" in
x86_64) DOCKER_PLATFORM=amd64;;
i686) DOCKER_PLATFORM=386;;
aarch64) DOCKER_PLATFORM=arm64/v8;;
armv7l) DOCKER_PLATFORM=arm/v7;;
*) DOCKER_PLATFORM=${{ matrix.platform }};;
esac
case "${{ matrix.distro }}" in
centos:7) IMAGE=quay.io/pypa/manylinux2014_${{ matrix.platform }}:latest;;
almalinux:8) IMAGE=quay.io/pypa/manylinux_2_28_${{ matrix.platform }}:latest;;
almalinux:9) IMAGE=quay.io/pypa/manylinux_2_34_${{ matrix.platform }}:latest;;
*) IMAGE=${{ matrix.distro }}
esac
docker run --platform linux/${DOCKER_PLATFORM} -v $(pwd):/gha ${IMAGE} sh -ec "cd /gha && bash ./build.sh"