-
Notifications
You must be signed in to change notification settings - Fork 61
193 lines (151 loc) · 4.87 KB
/
main.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
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
name: CI
on:
push:
branches: [auto]
pull_request:
workflow_dispatch:
merge_group:
types: [checks_requested]
jobs:
linux-ci-shared:
name: stable, Linux, shared library
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
# Install harfbuzz from the source in harfbuzz-sys. Use an out-of-tree
# build to avoid contaminating the source tree.
- name: Build harfbuzz
env:
PREFIX: /usr/local
run: |
make -f harfbuzz-sys/makefile.touch touch HARFBUZZ=harfbuzz-sys/harfbuzz
HARFDIR=`pwd`
pushd $RUNNER_TEMP
$HARFDIR/harfbuzz-sys/harfbuzz/configure --prefix=$PREFIX --without-icu --without-freetype --without-glib
make
sudo make install
# Make harfbuzz available for linking and confirm expected location
TEMP_PATH="$(pkg-config --variable=libdir harfbuzz)"
echo "LD_LIBRARY_PATH=$TEMP_PATH" >> $GITHUB_ENV
[[ "$TEMP_PATH" == "$PREFIX/lib" ]] || exit 1
popd
- name: Install stable toolchain
uses: dtolnay/rust-toolchain@stable
- name: Cargo build
run: cargo build --workspace
- name: Cargo test
run: cargo test --workspace
env:
RUST_BACKTRACE: 1
linux-ci-static:
name: stable, Linux, static linking, no pkg-config
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install stable toolchain
uses: dtolnay/rust-toolchain@stable
# Test the harfbuzz-sys package build to check the 'exclude's. We should
# do this where the embedded harfbuzz is statically linked, but we don't
# need to do it for every environment.
- name: Cargo package
run: cargo package --manifest-path=harfbuzz-sys/Cargo.toml --features bundled
- name: Cargo build
run: cargo build --workspace --features bundled
- name: Cargo test
run: cargo test --workspace --features bundled
env:
RUST_BACKTRACE: 1
mac-ci-shared:
name: stable, macOS, shared library
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
- name: install harfbuzz from homebrew
run: |
brew install harfbuzz
- name: Install stable toolchain
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt
- name: Cargo fmt
run: cargo fmt --all -- --check
- name: Cargo build
run: cargo build --workspace
- name: Cargo test
run: cargo test --workspace
env:
RUST_BACKTRACE: 1
mac-ci-static:
name: stable, macOS, static library
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
- name: Install stable toolchain
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt
- name: Cargo fmt
run: cargo fmt --all -- --check
- name: Cargo build
run: cargo build --workspace --features bundled
- name: Cargo test
run: cargo test --workspace --features bundled
env:
RUST_BACKTRACE: 1
windows-ci:
name: stable, Windows, static library
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- name: Install stable toolchain
uses: dtolnay/rust-toolchain@stable
- name: Cargo build
run: cargo build --workspace --features bundled
- name: Cargo test
run: cargo test --workspace --features bundled
env:
RUST_BACKTRACE: 1
wasm32-emscripten-ci:
name: stable, Emscripten, static library
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: mymindstorm/setup-emsdk@v12
with:
version: "3.1.44"
actions-cache-folder: emsdk-cache
- name: Install stable toolchain
uses: dtolnay/rust-toolchain@stable
with:
target: wasm32-unknown-emscripten
- name: Cargo build
run: cargo build --target wasm32-unknown-emscripten --workspace --no-default-features --features bundled
ios-ci-static:
name: stable, iOS, static library
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
- name: Install stable toolchain
uses: dtolnay/rust-toolchain@stable
with:
target: aarch64-apple-ios
- name: Cargo build
run: cargo build --target aarch64-apple-ios --workspace --no-default-features --features "bundled, coretext"
build_result:
name: Result
runs-on: ubuntu-latest
needs:
- "ios-ci-static"
- "linux-ci-static"
- "linux-ci-shared"
- "mac-ci-shared"
- "mac-ci-static"
- "wasm32-emscripten-ci"
- "windows-ci"
steps:
- name: Mark the job as successful
run: exit 0
if: success()
- name: Mark the job as unsuccessful
run: exit 1
if: "!success()"