-
Notifications
You must be signed in to change notification settings - Fork 1k
167 lines (136 loc) · 4.5 KB
/
ci-docker-build.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
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
# Copyright (c) 2021-2024 Petr Vorel <[email protected]>
name: "Test building in various distros in Docker"
on: [push, pull_request]
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
METADATA: asciidoctor
# 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
METADATA: asciidoc-pdf
TREE: out
- container: "debian:testing"
env:
CC: gcc
METADATA: asciidoctor-pdf
- container: "debian:oldstable"
env:
CC: clang
# other builds
- container: "fedora:latest"
env:
CC: clang
MAKE_INSTALL: 1
METADATA: asciidoctor-pdf
- container: "opensuse/leap:latest"
env:
CC: gcc
METADATA: asciidoc-pdf
- container: "debian:oldstable"
env:
CC: gcc
METADATA: asciidoctor
- container: "debian:testing"
env:
CC: clang
METADATA: asciidoctor-pdf
- container: "ubuntu:jammy"
env:
CC: gcc
METADATA: asciidoctor
TREE: out
- container: "ubuntu:bionic"
env:
CC: gcc
METADATA: asciidoc-pdf
container:
image: ${{ matrix.container }}
env: ${{ matrix.env }}
options: --security-opt seccomp=unconfined
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%%/*}"
./ci/$INSTALL.sh
if [ "$VARIANT" ]; then ./ci/$INSTALL.$VARIANT.sh; fi
- name: Compiler version
run: $CC --version
- name: ver_linux
run: ./ver_linux
- name: Autotools
run: ./build.sh -r autotools
- name: Configure
run: |
if [ "$METADATA" = "asciidoc-pdf" ]; then CONFIGURE_OPT_EXTRA="--with-metadata-generator=asciidoc --enable-metadata-pdf"; fi
if [ "$METADATA" = "asciidoctor" ]; then CONFIGURE_OPT_EXTRA="--with-metadata-generator=asciidoctor"; fi
if [ "$METADATA" = "asciidoctor-pdf" ]; then CONFIGURE_OPT_EXTRA="--with-metadata-generator=asciidoctor --enable-metadata-pdf"; fi
case "$VARIANT" in cross-compile*) BUILD="cross";; i386) BUILD="32";; *) BUILD="native";; esac
CONFIGURE_OPT_EXTRA="$CONFIGURE_OPT_EXTRA" ./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: Install
run: |
if [ "$MAKE_INSTALL" = 1 ]; then INSTALL_OPT="-i"; fi
./build.sh -r install -o ${TREE:-in} $INSTALL_OPT