-
Notifications
You must be signed in to change notification settings - Fork 56
138 lines (132 loc) · 3.94 KB
/
rust.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
name: Rust
on:
push:
branches: [master]
pull_request:
workflow_dispatch:
merge_group:
types: [checks_requested]
env:
RUST_BACKTRACE: 1
SHELL: /bin/bash
CARGO_INCREMENTAL: 0
jobs:
mac:
runs-on: macos-latest
strategy:
fail-fast: false
matrix:
features: ["--features debugmozjs", ""]
env:
RUSTC_WRAPPER: sccache
CCACHE: sccache
SCCACHE_GHA_ENABLED: "true"
steps:
- uses: actions/checkout@v3
- name: Install deps
run: brew install python llvm yasm
- name: Run sccache-cache
uses: mozilla-actions/[email protected]
- name: Build
run: |
cargo build --verbose ${{ matrix.features }}
cargo test --verbose ${{ matrix.features }}
linux:
env:
RUSTC_WRAPPER: "sccache"
CCACHE: sccache
SCCACHE_GHA_ENABLED: "true"
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
features: ["--features debugmozjs", ""]
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
- name: Install deps
run: |
sudo apt install llvm -y
- name: Run sccache-cache
uses: mozilla-actions/[email protected]
- name: Build
run: |
cargo build --verbose ${{ matrix.features }}
cargo test --verbose ${{ matrix.features }}
windows:
runs-on: windows-2019
strategy:
fail-fast: false
matrix:
features: ["--features debugmozjs", ""]
env:
LINKER: "lld-link.exe"
CC: "clang-cl"
CXX: "clang-cl"
MOZTOOLS_PATH: "${{ github.workspace }}\\target\\dependencies\\moztools-4.0"
CCACHE: sccache
SCCACHE_GHA_ENABLED: "true"
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
- name: Install deps
run: |
curl -SL "https://github.com/servo/servo-build-deps/releases/download/msvc-deps/moztools-4.0.zip" --create-dirs -o target/dependencies/moztools.zip
cd target/dependencies && unzip -qo moztools.zip -d .
- name: Run sccache-cache
uses: mozilla-actions/[email protected]
- name: Build Windows
shell: cmd
run: |
cargo test --verbose ${{ matrix.features }}
android:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install NDK
uses: nttld/setup-ndk@v1
id: setup-ndk
with:
ndk-version: r21d
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
targets: armv7-linux-androideabi
- name: Build
env:
ANDROID_NDK_HOME: ${{ steps.setup-ndk.outputs.ndk-path }}
run: |
./android-build cargo build --target="armv7-linux-androideabi"
# The integrity check is currently broken. See issue #345.
#
# Integrity:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v3
# - name: Get mozjs
# run: |
# bash ./mozjs/etc/get_mozjs.sh
# - name: Apply patch
# run: |
# python3 ./mozjs/etc/update.py --no-commit mozjs.tar.xz
# # Run `git add` here to force CRLF converted into LF
# # so that we can check diff properly in next run
# git add --all mozjs
# - name: Check patch integrity
# working-directory: ./mozjs
# # Because we've added files in previous run, we need to
# # check diff with `--staged`.
# run: |
# git diff --staged --no-ext-diff --quiet --exit-code
build_result:
name: Result
runs-on: ubuntu-latest
needs: ["mac", "linux", "windows", "android"]
if: ${{ always() }}
steps:
- name: Mark the job as successful
if: ${{ !contains(needs.*.result, 'failure') && !contains(needs.*.result, 'cancelled') }}
run: exit 0
- name: Mark the job as unsuccessful
if: ${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') }}
run: exit 1