-
Notifications
You must be signed in to change notification settings - Fork 1.1k
205 lines (169 loc) · 5.63 KB
/
ci-docker-build.yml
File metadata and controls
205 lines (169 loc) · 5.63 KB
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
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
# Copyright (c) 2021-2024 Petr Vorel <pvorel@suse.cz>
name: "Test building in various distros in Docker"
on:
push:
pull_request:
workflow_dispatch:
inputs:
SERIES_ID:
description: LTP patch series ID
required: false
default: ''
SERIES_MBOX:
description: LTP patch series URL
required: false
default: ''
permissions:
contents: read # to fetch code (actions/checkout)
jobs:
job:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
# 32bit build
- container: "debian:stable"
env:
CC: gcc
VARIANT: i386
# cross compilation builds
- container: "debian:stable"
env:
ARCH: ppc64el
CC: powerpc64le-linux-gnu-gcc
MAKE_INSTALL: 1
TREE: out
VARIANT: cross-compile
- container: "debian:stable"
env:
ARCH: arm64
CC: aarch64-linux-gnu-gcc
MAKE_INSTALL: 1
TREE: out
VARIANT: cross-compile
- container: "debian:stable"
env:
ARCH: s390x
CC: s390x-linux-gnu-gcc
MAKE_INSTALL: 1
TREE: out
VARIANT: cross-compile
# musl (native)
- container: "alpine:latest"
env:
CC: gcc
# build with minimal dependencies
- container: "debian:stable"
env:
CC: gcc
TREE: out
VARIANT: minimal
# oldest distros
- container: "opensuse/archive:42.2"
env:
CC: gcc
- container: "quay.io/centos/centos:stream9"
env:
CC: gcc
TREE: out
- container: "debian:testing"
env:
CC: gcc
- container: "debian:oldstable"
env:
CC: clang
# other builds
- container: "fedora:latest"
env:
CC: clang
MAKE_INSTALL: 1
- container: "opensuse/leap:latest"
env:
CC: gcc
- container: "debian:oldstable"
env:
CC: gcc
- container: "debian:testing"
env:
CC: clang
- container: "ubuntu:jammy"
env:
CC: gcc
TREE: out
- container: "ubuntu:bionic"
env:
CC: gcc
container:
image: ${{ matrix.container }}
env: ${{ matrix.env }}
options: --privileged -v/boot:/boot
steps:
- name: Show OS
run: cat /etc/os-release
- name: Git checkout
uses: actions/checkout@v1
- name: Install additional packages
run: |
INSTALL=${{ matrix.container }}
INSTALL="${INSTALL%%:*}"
INSTALL="${INSTALL%%/*}"
ACTION="$VARIANT" ./ci/$INSTALL.sh || if [ $? -eq 106 ]; then
echo "::warning ::Skipping job due broken repositories"
./ci/tools/patchwork.sh check \
"${{ inputs.SERIES_ID }}" \
"${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" \
"${{ matrix.container }}" \
"pending" "Skipping job due broken repositories"
exit 0
fi
if [ "$VARIANT" ]; then ./ci/$INSTALL.$VARIANT.sh; fi
- name: Compiler version
run: $CC --version
- name: Apply Patchwork series
if: inputs.SERIES_ID != '' && inputs.SERIES_MBOX != ''
env:
PATCHWORK_TOKEN: ${{ secrets.PATCHWORK_TOKEN }}
run: |
git config --global user.name 'GitHub CI'
git config --global user.email 'github@example.com'
git config --global --add safe.directory "$GITHUB_WORKSPACE"
git checkout -b review_patch_series_"${{ inputs.SERIES_ID }}"
curl -k -L --retry 3 --max-redirs 1 --location-trusted "${{ inputs.SERIES_MBOX }}" | git am
./ci/tools/patchwork.sh state "${{ inputs.SERIES_ID }}" "needs-review-ack"
- name: ver_linux
run: ./ver_linux
- name: Autotools
run: ./build.sh -r autotools
- name: Configure
run: |
case "$VARIANT" in cross-compile*) BUILD="cross";; i386) BUILD="32";; *) BUILD="native";; esac
./build.sh -r configure -o ${TREE:-in} -t $BUILD -c $CC
- name: Compile
run: ./build.sh -r build -o ${TREE:-in}
- name: Test C API
run: |
case "$VARIANT" in cross-compile*) BUILD="cross";; i386) BUILD="32";; *) BUILD="native";; esac
./build.sh -r test-c -o ${TREE:-in} -t $BUILD
- name: Test shell API
run: |
case "$VARIANT" in cross-compile*) BUILD="cross";; i386) BUILD="32";; *) BUILD="native";; esac
./build.sh -r test-shell -o ${TREE:-in} -t $BUILD
- name: Test shell loader
run: |
case "$VARIANT" in cross-compile*) BUILD="cross";; i386) BUILD="32";; *) BUILD="native";; esac
./build.sh -r test-shell-loader -o ${TREE:-in} -t $BUILD
- name: Install
run: |
if [ "$MAKE_INSTALL" = 1 ]; then INSTALL_OPT="-i"; fi
./build.sh -r install -o ${TREE:-in} $INSTALL_OPT
- name: Send results to Patchwork
if: always() && inputs.SERIES_ID != '' && inputs.SERIES_MBOX != ''
env:
PATCHWORK_TOKEN: ${{ secrets.PATCHWORK_TOKEN }}
run: |
./ci/tools/patchwork.sh check \
"${{ inputs.SERIES_ID }}" \
"${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" \
"${{ matrix.container }}" \
"${{ job.status }}"