@@ -3,176 +3,146 @@ name: CI
33on : [push, pull_request]
44
55jobs :
6- ubuntu-latest-html-tests :
6+ build-test-linux :
77 runs-on : ubuntu-latest
8- steps :
9- - uses : actions/checkout@v1
10- with :
11- fetch-depth : 1
12- - name : Install dependencies
13- run : sudo apt install -y libfltk1.3-dev libssl-dev xvfb x11-apps x11-utils imagemagick
8+ container :
9+ image : ${{ matrix.os == 'alpine' && 'alpine:latest' || matrix.os == 'ubuntu-20.04' && 'ubuntu:20.04' || 'ubuntu:latest' }}
10+ strategy :
11+ matrix :
12+ os : [ubuntu, ubuntu-20.04, alpine]
13+ build-system : [autotools, meson]
14+ compiler : [gcc, clang]
15+ tls : [openssl, mbedtls, none]
16+ html-tests : [true, false]
17+ exclude :
18+ - os : ubuntu
19+ html-tests : false
20+ - os : ubuntu-20.04
21+ html-tests : true
22+ - os : alpine
23+ html-tests : true
24+ - os : alpine
25+ tls : none
26+ - os : ubuntu-20.04
27+ tls : none
1428
15- - name : autogen
16- run : ./autogen.sh
17- - name : Make install dir
18- run : mkdir install build
19- - name : configure
20- run : cd build && ../configure --prefix=$(readlink -f ../install) --enable-html-tests
21- - name : make
22- run : cd build && make
23- - name : make install
24- run : cd build && make install
25- - name : Copy config to .dillo
26- run : |
27- mkdir -p ~/.dillo/
28- cp install/etc/dillo/* ~/.dillo/
29- - name : make check
30- run : |
31- export DILLOBIN=$(readlink -f install/bin/dillo)
32- cd build && make check || (cat test/html/test-suite.log; false)
33- export DILLOBIN=
34- - name : Check release fits in a floppy disk of 1.44 MB
35- run : |
36- cd build
37- make dist-gzip
38- size=$(stat -c %s dillo-*.tar.gz)
39- floppy=$((1474560 - 32*1024)) # Leave room for FAT table
40- echo "Floppy occupation: $(($size * 100 / $floppy)) %"
41- if [ $size -lt $floppy ]; then
42- echo 'OK: Fits in floopy disk'
43- else
44- echo "FAIL: Release size too big: $size / $floppy"
45- exit 1
46- fi
47- - name : make distcheck (with HTML tests)
48- run : |
49- export DILLOBIN=
50- mkdir build-distcheck install-distcheck
51- cd build-distcheck && ../configure --prefix=$(readlink -f ../install-distcheck) --enable-html-tests
52- make distcheck DISTCHECK_CONFIGURE_FLAGS=--enable-html-tests
53- # - name: Remove pipes
54- # run: find test/html -type p -delete || true
55- # - name: Archive production artifacts
56- # uses: actions/upload-artifact@v3
57- # with:
58- # name: upload-html-test-results
59- # path: |
60- # build/test/html
61- ubuntu-latest-no-tls :
62- needs : ubuntu-latest-html-tests
63- runs-on : ubuntu-latest
64- steps :
65- - uses : actions/checkout@v1
66- with :
67- fetch-depth : 1
68- - name : Install dependencies
69- run : sudo apt install -y libfltk1.3-dev
70- - name : autogen
71- run : ./autogen.sh
72- - name : configure
73- run : ./configure --disable-tls
74- - name : make
75- run : make
76- - name : make check
77- run : make check
78- - name : make distcheck
79- run : make distcheck
80- ubuntu-latest-mbedtls2 :
81- needs : ubuntu-latest-html-tests
82- runs-on : ubuntu-latest
8329 steps :
84- - uses : actions/checkout@v1
85- with :
86- fetch-depth : 1
87- - name : Install dependencies
88- run : sudo apt install -y libfltk1.3-dev libmbedtls-dev
89- - name : autogen
90- run : ./autogen.sh
91- - name : configure
92- run : ./configure --disable-openssl
93- - name : make
94- run : make
95- - name : make check
96- run : make check
97- - name : make distcheck
98- run : make distcheck
99- ubuntu-latest-openssl-3 :
100- needs : ubuntu-latest-html-tests
101- runs-on : ubuntu-latest
102- steps :
103- - uses : actions/checkout@v1
104- with :
105- fetch-depth : 1
106- - name : Install dependencies
107- run : sudo apt install -y libfltk1.3-dev libssl-dev
108- - name : autogen
109- run : ./autogen.sh
110- - name : configure
111- run : ./configure --disable-mbedtls
112- - name : make
113- run : make
114- - name : make check
115- run : make check
116- - name : make distcheck
117- run : make distcheck
118- ubuntu-latest-with-old-std :
119- needs : ubuntu-latest-html-tests
120- runs-on : ubuntu-latest
121- steps :
122- - uses : actions/checkout@v1
123- with :
124- fetch-depth : 1
125- - name : Install dependencies
126- run : sudo apt install -y libfltk1.3-dev libssl-dev
127- - name : autogen
128- run : ./autogen.sh
129- - name : configure
130- run : ./configure --disable-mbedtls CFLAGS="-Werror" CXXFLAGS="-Werror"
131- - name : make
132- run : make
133- - name : make check
134- run : make check
135- ubuntu-20-04-openssl-1-1 :
136- needs : ubuntu-latest-html-tests
137- runs-on : ubuntu-20.04
138- steps :
139- - uses : actions/checkout@v1
140- with :
141- fetch-depth : 1
142- - name : Install dependencies
143- run : sudo apt install -y libfltk1.3-dev libssl-dev
144- - name : autogen
145- run : ./autogen.sh
146- - name : configure
147- run : ./configure --disable-mbedtls
148- - name : make
149- run : make
150- - name : make check
151- run : make check
152- - name : make distcheck
153- run : make distcheck
154- alpine-mbedtls-3_6_0 :
155- runs-on : ubuntu-latest
156- steps :
157- - uses : actions/checkout@v4
158- - uses : jirutka/setup-alpine@v1
159- with :
160- packages : >
161- build-base
162- autoconf
163- automake
164- fltk-dev
165- libpng-dev
166- libjpeg-turbo-dev
167- mbedtls-dev
168- - run : |
169- ./autogen.sh
170- ./configure
171- make
172- make check
173- shell: alpine.sh {0}
30+ - name : Checkout repository
31+ uses : actions/checkout@v4
32+
33+ - name : Install dependencies
34+ run : |
35+ if [ ${{ matrix.os }} = "ubuntu" ] || [ ${{ matrix.os }} = "ubuntu-20.04" ]; then
36+ apt-get update
37+ apt-get install -y build-essential clang git imagemagick libfltk1.3-dev libssl-dev lld meson ninja-build x11-apps x11-utils xvfb
38+ else
39+ apk add build-base autoconf automake clang fltk-dev git libpng-dev libjpeg-turbo-dev lld mbedtls-dev meson ninja-build openssl-dev
40+ fi
41+
42+ - name : Set git safe directory
43+ run : git config --global --add safe.directory ${GITHUB_WORKSPACE}
44+
45+ - name : Prepare Autotools
46+ run : |
47+ if [ ${{ matrix.build-system }} = "autotools" ]; then
48+ ./autogen.sh
49+ mkdir install build
50+ fi
51+
52+ - name : Configure Build
53+ run : |
54+ HTML_TESTS_OPT=""
55+ if [ "${{matrix.compiler}}" = "clang" ]; then
56+ export CC=clang CXX=clang++ LDFLAGS="-fuse-ld=lld -Wl,--as-needed"
57+ fi
58+ if [ "${{ matrix.build-system }}" = "autotools" ]; then
59+ if [ "${{ matrix.tls }}" = "none" ]; then
60+ export TLS_OPT="--disable-tls"
61+ elif [ "${{ matrix.tls }}" = "mbedtls" ]; then
62+ export TLS_OPT="--disable-openssl"
63+ else
64+ export TLS_OPT="--disable-mbedtls"
65+ fi
66+ if [ "${{ matrix.html-tests }}" = "true" ]; then
67+ export HTML_TESTS_OPT="--enable-html-tests"
68+ fi
69+ else
70+ if [ "${{ matrix.tls }}" = "none" ]; then
71+ export TLS_OPT="-Dtls=disabled -Dopenssl=false -Dmbedtls=false"
72+ elif [ "${{ matrix.tls }}" = "mbedtls" ]; then
73+ export TLS_OPT="-Dmbedtls=true -Dopenssl=false"
74+ else
75+ export TLS_OPT="-Dopenssl=true -Dmbedtls=false"
76+ fi
77+ if [ "${{ matrix.html-tests }}" = "true" ]; then
78+ export HTML_TESTS_OPT="-Denable-html-tests=true"
79+ fi
80+ fi
81+
82+ if [ "${{ matrix.build-system }}" = "autotools" ]; then
83+ cd build
84+ ../configure --prefix=$(readlink -f ../install) ${TLS_OPT} ${HTML_TESTS_OPT}
85+ else
86+ meson setup build --prefix="$(pwd)/install" ${TLS_OPT} ${HTML_TESTS_OPT}
87+ fi
88+
89+ - name : Build Dillo for ${{ matrix.os }} with ${{ matrix.build-system }} and ${{ matrix.compiler }}
90+ run : |
91+ if [ "${{ matrix.build-system }}" = "autotools" ]; then
92+ cd build
93+ make && make install
94+ mkdir -p ~/.dillo/
95+ cp install/etc/dillo/* ~/.dillo/
96+ else
97+ ninja -C build
98+ fi
99+
100+ - name : Run tests
101+ run : |
102+ if [ "${{ matrix.build-system }}" = "autotools" ]; then
103+ cd build
104+ export DILLOBIN=$(readlink -f bin/dillo)
105+ make check || (cat test/html/test-suite.log; false)
106+ export DILLOBIN=
107+ else
108+ meson test -C build
109+ fi
110+
111+ - name : Check release fits in a floppy disk of 1.44 MB
112+ run : |
113+ if [ "${{ matrix.build-system }}" = "autotools" ]; then
114+ cd build
115+ make dist-gzip
116+ size=$(stat -c %s dillo-*.tar.gz)
117+ floppy=$((1474560 - 32*1024)) # Leave room for FAT table
118+ echo "Floppy occupation: $(($size * 100 / $floppy)) %"
119+ if [ $size -lt $floppy ]; then
120+ echo 'OK: Fits in floopy disk'
121+ else
122+ echo "FAIL: Release size too big: $size / $floppy"
123+ exit 1
124+ fi
125+ else
126+ echo "Skipping floppy disk check for Meson build; not yet implemented"
127+ fi
128+
129+ - name : Run distcheck
130+ run : |
131+ HTML_TESTS_OPT=""
132+ if [ "${{ matrix.html-tests }}" = "true" ]; then
133+ HTML_TESTS_OPT="--enable-html-tests"
134+ fi
135+ if [ "${{ matrix.build-system }}" = "autotools" ]; then
136+ mkdir build-distcheck install-distcheck
137+ cd build-distcheck && ../configure --prefix=$(readlink -f ../install-distcheck) ${HTML_TESTS_OPT}
138+ make distcheck DISTCHECK_CONFIGURE_FLAGS="${HTML_TESTS_OPT}"
139+ else
140+ if [ "${{ matrix.os}}" = "ubuntu*" ]; then
141+ meson dist -C build
142+ fi
143+ fi
144+
174145 macOS-13-openssl-1-1 :
175- needs : ubuntu-latest-html-tests
176146 runs-on : macos-13
177147 steps :
178148 - uses : actions/checkout@v1
@@ -190,8 +160,8 @@ jobs:
190160 run : make check
191161 - name : make distcheck
192162 run : make distcheck
163+
193164 macOS-13-openssl-3 :
194- needs : ubuntu-latest-html-tests
195165 runs-on : macos-13
196166 steps :
197167 - uses : actions/checkout@v1
@@ -211,8 +181,8 @@ jobs:
211181 run : make check
212182 - name : make distcheck
213183 run : make distcheck
184+
214185 freebsd-14-openssl-3 :
215- needs : ubuntu-latest-html-tests
216186 runs-on : ubuntu-latest
217187 steps :
218188 - uses : actions/checkout@v4
@@ -235,8 +205,8 @@ jobs:
235205 make
236206 make check
237207 ldd src/dillo
208+
238209 windows-mbedtls :
239- needs : ubuntu-latest-html-tests
240210 runs-on : windows-latest
241211 steps :
242212 - run : git config --global core.autocrlf input
0 commit comments