-
Notifications
You must be signed in to change notification settings - Fork 147
56 lines (56 loc) · 1.54 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
name: ci
on:
pull_request:
push:
branches:
- master
jobs:
test:
name: test
runs-on: ubuntu-latest
strategy:
matrix:
rust: [stable, nightly]
env:
CRATE_NAME: gluon
CARGO_INCREMENTAL: 0 # Incremental compilation is slower and bloats the cache
RUST_BACKTRACE: 1
# RUSTC_WRAPPER: sccache
SCCACHE_CACHE_SIZE: 500M
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Use cache
uses: actions/cache@v2
with:
path: |
~/bin
key: ${{ runner.os }}-${{ matrix.rust }}
- name: Install Rust
uses: hecrj/setup-rust-action@v1
with:
rust-version: ${{ matrix.rust }}
- uses: Swatinem/rust-cache@v2
- run: echo "$HOME/bin" >> $GITHUB_PATH
- run: mkdir -p $HOME/bin
- name: Setup tools
if: steps.cache.outputs.cache-hit != 'true'
run: |
# ./scripts/install_sccache.sh $TARGET
source ~/.cargo/env || true
./scripts/install_mdbook.sh $TARGET
- name: Run tests
run: |
if [ ! -z $DISABLE_TESTS ]; then
return
elif [[ -z ${WASM+set} ]]; then
mdbook build book
./scripts/ci.sh
if ! git diff-index HEAD --; then
echo "Detected changes in the source after running tests"
exit 1
fi
else
rustup target add wasm32-unknown-unknown
cargo check --target wasm32-unknown-unknown -p gluon_c-api
fi