-
Notifications
You must be signed in to change notification settings - Fork 0
175 lines (168 loc) · 6.07 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
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
name: IncludeJS
on:
push:
jobs:
test:
strategy:
fail-fast: false
matrix:
platform:
- os: macos-latest
cc: clang
cxx: clang++
type: static
backend: JavaScriptCore
- os: macos-latest
cc: clang
cxx: clang++
type: shared
backend: JavaScriptCore
# TODO(RaisinTen): Support other OSs and static configuration for
# the V8 backend.
- os: macos-latest
cc: clang
cxx: clang++
type: shared
backend: V8
- os: ubuntu-latest
cc: clang
cxx: clang++
type: static
backend: JavaScriptCore
javascriptcore_version: "4.0"
options: -DINCLUDEJS_BACKEND_JAVASCRIPTCORE_API_VERSION:STRING=4.0
- os: ubuntu-latest
cc: gcc
cxx: g++
type: static
backend: JavaScriptCore
javascriptcore_version: "4.0"
options: -DINCLUDEJS_BACKEND_JAVASCRIPTCORE_API_VERSION:STRING=4.0
- os: ubuntu-latest
cc: clang
cxx: clang++
type: shared
backend: JavaScriptCore
javascriptcore_version: "4.0"
options: -DINCLUDEJS_BACKEND_JAVASCRIPTCORE_API_VERSION:STRING=4.0
- os: ubuntu-latest
cc: gcc
cxx: g++
type: shared
backend: JavaScriptCore
javascriptcore_version: "4.0"
options: -DINCLUDEJS_BACKEND_JAVASCRIPTCORE_API_VERSION:STRING=4.0
- os: ubuntu-latest
cc: clang
cxx: clang++
type: static
backend: JavaScriptCore
javascriptcore_version: "6.0"
options: -DINCLUDEJS_BACKEND_JAVASCRIPTCORE_API_VERSION:STRING=6.0
- os: ubuntu-latest
cc: gcc
cxx: g++
type: static
backend: JavaScriptCore
javascriptcore_version: "6.0"
options: -DINCLUDEJS_BACKEND_JAVASCRIPTCORE_API_VERSION:STRING=6.0
- os: ubuntu-latest
cc: clang
cxx: clang++
type: shared
backend: JavaScriptCore
javascriptcore_version: "6.0"
options: -DINCLUDEJS_BACKEND_JAVASCRIPTCORE_API_VERSION:STRING=6.0
- os: ubuntu-latest
cc: gcc
cxx: g++
type: shared
backend: JavaScriptCore
javascriptcore_version: "6.0"
options: -DINCLUDEJS_BACKEND_JAVASCRIPTCORE_API_VERSION:STRING=6.0
# Sanitizers
- os: ubuntu-latest
cc: clang
cxx: clang++
type: static
options: -DINCLUDEJS_ADDRESS_SANITIZER:BOOL=ON
backend: JavaScriptCore
- os: ubuntu-latest
cc: clang
cxx: clang++
type: static
options: -DINCLUDEJS_UNDEFINED_SANITIZER:BOOL=ON
backend: JavaScriptCore
- os: macos-latest
cc: clang
cxx: clang++
type: static
options: -DINCLUDEJS_ADDRESS_SANITIZER:BOOL=ON
backend: JavaScriptCore
- os: macos-latest
cc: clang
cxx: clang++
type: static
options: -DINCLUDEJS_UNDEFINED_SANITIZER:BOOL=ON
backend: JavaScriptCore
runs-on: ${{ matrix.platform.os }}
env:
CC: ${{ matrix.platform.cc }}
CXX: ${{ matrix.platform.cxx }}
steps:
- name: Install dependencies (GNU/Linux)
if: runner.os == 'linux'
run: |
sudo apt-get update --yes
sudo apt-get install --yes clang-format libjavascriptcoregtk-${{ matrix.platform.javascriptcore_version }}-dev
# See https://github.com/actions/runner-images/issues/8659
- name: Workaround Clang issue (GNU/Linux)
if: runner.os == 'linux' && matrix.platform.cc == 'clang'
run: |
sudo apt-get purge -y g++-13 gcc-13 libstdc++-13-dev
sudo apt-get install -y --allow-downgrades libstdc++-12-dev libstdc++6=12.* libgcc-s1=12.*
- uses: actions/checkout@v4
- name: Install dependencies (macOS)
if: runner.os == 'macos'
run: brew bundle
env:
HOMEBREW_NO_ANALYTICS: 1
HOMEBREW_NO_AUTO_UPDATE: 1
- run: cmake --version
- name: Configure IncludeJS (static)
if: matrix.platform.type == 'static'
run: >
cmake -S . -B ./build
-DCMAKE_BUILD_TYPE:STRING=Release
-DINCLUDEJS_BACKEND:STRING=${{ matrix.platform.backend }}
-DINCLUDEJS_TESTS:BOOL=ON
-DINCLUDEJS_DOCS:BOOL=OFF
-DBUILD_SHARED_LIBS:BOOL=OFF
-DCMAKE_COMPILE_WARNING_AS_ERROR:BOOL=ON
${{ matrix.platform.options }}
- name: Configure IncludeJS (shared)
if: matrix.platform.type == 'shared'
run: >
cmake -S . -B ./build
-DCMAKE_BUILD_TYPE:STRING=Release
-DINCLUDEJS_BACKEND:STRING=${{ matrix.platform.backend }}
-DINCLUDEJS_TESTS:BOOL=ON
-DINCLUDEJS_DOCS:BOOL=OFF
-DBUILD_SHARED_LIBS:BOOL=ON
-DCMAKE_COMPILE_WARNING_AS_ERROR:BOOL=ON
${{ matrix.platform.options }}
- run: cmake --build ./build --config Release --target clang_format_test
- run: cmake --build ./build --config Release --parallel 4
- run: >
cmake --install ./build --prefix ./build/dist --config Release --verbose
--component includejs
- run: >
cmake --install ./build --prefix ./build/dist --config Release --verbose
--component includejs_dev
# Not every CTest version supports the --test-dir option. If such option
# is not recognized, `ctest` will successfully exit finding no tests.
# Better to be sure and `cd` all the time here.
- run: cd ./build && ctest --build-config Release --output-on-failure --parallel
env:
# See https://clang.llvm.org/docs/UndefinedBehaviorSanitizer.html
UBSAN_OPTIONS: print_stacktrace=1