Repository navigation
136 lines (121 loc) · 4.6 KB
/
Copy pathBuild.yml
File metadata and controls
136 lines (121 loc) · 4.6 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
name: Build
on:
push:
branches: [main, master]
tags: ["v*"]
pull_request:
workflow_dispatch:
jobs:
engine:
name: engine + headless browser (${{ matrix.name }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- name: linux-x86_64
os: ubuntu-latest
ldflags: -Wl,--gc-sections -s
- name: windows-x86_64
os: windows-latest
ldflags: -Wl,--gc-sections -s
- name: macos
os: macos-latest
ldflags: -Wl,-dead_strip
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v4
- name: Check licence files are present
run: |
test -f NOTICE.md && test -f fonts/OFL-NotoSansCJK.txt
grep -q "Adobe" src/mwe_font.h
- name: Build engine CLI
run: |
cc -std=c99 -Wall -Wextra -Os -ffunction-sections -fdata-sections \
-fno-asynchronous-unwind-tables -fno-ident \
${{ matrix.ldflags }} mwe.c -o mwe
ls -l mwe*
- name: Smoke test (render test.html and malformed input)
run: |
./mwe test.html out.bmp 800
./mwe test2.html out2.bmp 960
test -s out.bmp && test -s out2.bmp
head -c 2 out.bmp | grep -q '^BM$'
printf 'plain <b>text</b> A < 5 <unclosed' > bad.html
./mwe bad.html bad.bmp 300
test -s bad.bmp
./mwe --licenses | grep -q "Adobe"
./mwe test3.html cjk.bmp 720 && test -s cjk.bmp
./mwe test4.html ko.bmp 700 && test -s ko.bmp
./mwe test5.html css.bmp 620 && test -s css.bmp
./mwe test6.html img.bmp 640 && test -s img.bmp
./mwe test8.html is.bmp 520 && test -s is.bmp
./mwe test10.html fit.bmp 640 && test -s fit.bmp
./mwe test11.html flex.bmp 400 && test -s flex.bmp
- name: No libc/POSIX name clashes (macOS SDK declares fls, ffs, ...)
run: cc -std=gnu11 -fsyntax-only -Wall -Wextra tests/clash.c
- name: JavaScript regression tests
run: sh tests/js/run.sh
- name: Embedded root certificates parse and are usable
run: cc -std=gnu11 -O1 -Wall -Wextra tests/roots_check.c -o roots_check && ./roots_check
- name: Strict build without the legacy root tier compiles
run: cc -std=gnu11 -fsyntax-only -Wall -Wextra -DMWE_LIB -DMB_NO_LEGACY_ROOTS browser/mb_tls.c
- name: Image decoders match Pillow
run: |
python3 -m pip install --quiet pillow
python3 tests/img/run.py
- name: Build and test headless MiniBrowser
run: |
cc -std=gnu11 -Wall -Wextra -Os -DMWE_LIB \
mwe.c browser/minibrowser.c browser/mb_tls.c browser/mb_shot.c -o mb_shot
./mb_shot about:home home.bmp 1000 640
./mb_shot "$PWD/test.html" page.bmp 1000 640
./mb_shot "$PWD/browser/tests/pages/ext.html" ext.bmp 900 520
./mb_shot "$PWD/browser/tests/pages/js_demo.html" js.bmp 800 520 --wait 300 --click 70 190 --click 70 190 --wait 100
test -s home.bmp && test -s page.bmp && test -s ext.bmp && test -s js.bmp
- name: Report binary sizes
run: |
for f in mwe mwe.exe mb_shot mb_shot.exe; do
[ -f "$f" ] && echo "${{ matrix.name }} $f: $(wc -c < "$f") bytes" >> "$GITHUB_STEP_SUMMARY"
done
true
- uses: actions/upload-artifact@v4
with:
name: engine-${{ matrix.name }}
path: |
mwe
mwe.exe
home.bmp
page.bmp
js.bmp
if-no-files-found: ignore
minibrowser-windows:
name: MiniBrowser (Windows)
runs-on: windows-latest
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v4
- name: Build minibrowser.exe
run: |
gcc -std=gnu11 -Wall -Wextra -Os -s -ffunction-sections -fdata-sections \
-Wl,--gc-sections -DMWE_LIB -mwindows \
mwe.c browser/minibrowser.c browser/mb_tls.c browser/mb_win32.c \
-Wl,--stack,8388608 \
-o minibrowser.exe -lws2_32 -lgdi32 -luser32 -ladvapi32
ls -l minibrowser.exe
echo "minibrowser.exe: $(wc -c < minibrowser.exe) bytes" >> "$GITHUB_STEP_SUMMARY"
- uses: actions/upload-artifact@v4
with:
name: minibrowser-windows-x86_64
path: minibrowser.exe
tls-e2e:
name: TLS end-to-end (openssl s_server)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Run browser/tests/tls_e2e.sh
run: bash browser/tests/tls_e2e.sh