-
Notifications
You must be signed in to change notification settings - Fork 0
/
.cirrus.yml
55 lines (54 loc) · 1.92 KB
/
.cirrus.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
task:
container: {image: "rust:1.76-bookworm"}
# Cache config.
registry_cache:
folder: $CARGO_HOME/registry
fingerprint_script: cat Cargo.lock
#target_cache:
# folder: target
# fingerprint_script:
# - rustc --version
# - cat Cargo.lock
before_cache_script: rm -rf $CARGO_HOME/registry/index
# Common install script.
install_script:
- apt-get update
- apt-get install -y libclang-dev libspeechd-dev
# Individual tasks using the same config.
matrix:
# Linut task.
- name: Lint
script: cargo clippy
# Linux tests.
- name: Linux tests
script:
- cargo test --no-run
- cargo test
# Site generation task.
- name: site_gen
depends_on: ["Linux tests"]
rustup_target_script: rustup target add wasm32-unknown-unknown
cargo_install_script: cargo install wasm-bindgen-cli@0.2.90
cargo_build_script: cargo build --target wasm32-unknown-unknown
copy_script: cp -r ./web ./_site
wasm_bindgen_script: wasm-bindgen --target web --out-dir _site/ target/wasm32-unknown-unknown/debug/sgs.wasm
site_artifacts:
path: "_site/"
publish_task:
only_if: $BRANCH == 'main'
depends_on:
- Lint
- site_gen
container: {image: "node:20-bookworm"}
env:
NETLIFY_AUTH_TOKEN: ENCRYPTED[022956827617e8b2cf518ed37953f6028a49c0928ff43ccfe6edbcffe907c707b5c8209a2a25030854b324c27c99199d]
NETLIFY_SITE_ID: ENCRYPTED[1b67d4169a6bb34256b7409a0843b04d847d6397f45127da970bd7afc077f83a1e7765e1251a316cc9c9bc9d2cff78a0]
install_script:
- apt-get -y update
- apt-get -y install python3 python3-lxml wget unzip
# https://github.com/netlify/cli/issues/1870
- npm install --unsafe-perm=true -g netlify-cli
script:
- wget https://api.cirrus-ci.com/v1/artifact/build/${CIRRUS_BUILD_ID}/site.zip
- unzip site.zip
- netlify deploy --auth $NETLIFY_AUTH_TOKEN --site $NETLIFY_SITE_ID --dir=_site --prod