-
-
Notifications
You must be signed in to change notification settings - Fork 3
98 lines (93 loc) · 2.61 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
on:
push:
branches:
- main
pull_request:
name: Continuous integration
jobs:
test:
name: Test suite
runs-on: ubuntu-latest
strategy:
matrix:
rust:
- stable
- beta
- nightly
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust }}
components: clippy, rustfmt
- uses: Swatinem/rust-cache@v2
- name: Check formatting
run: cargo fmt -- --check
if: matrix.rust == 'stable'
- name: Clippy
run: cargo clippy -- -W clippy::all
if: matrix.rust == 'stable'
env:
RUST_BACKTRACE: full
- name: Build and test
run: cargo test
env:
RUST_MIN_STACK: 8388608
RUST_BACKTRACE: full
minimal-versions:
name: minimal versions check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly
- uses: Swatinem/rust-cache@v2
- name: Remove lock
run: rm Cargo.lock
- run: cargo build -Z minimal-versions
env:
RUST_BACKTRACE: full
web:
name: web build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
target: wasm32-unknown-unknown
- uses: Swatinem/rust-cache@v2
- name: Install trunk
run: wget -qO- https://github.com/thedodd/trunk/releases/download/${VERSION}/trunk-x86_64-unknown-linux-gnu.tar.gz | tar -xzf-
env:
VERSION: "v0.16.0"
- name: Run trunk
run: ./trunk build --release
deploy:
runs-on: ubuntu-latest
needs: [web, test, minimal-versions]
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
target: wasm32-unknown-unknown
- uses: Swatinem/rust-cache@v2
- name: Install trunk
run: wget -qO- https://github.com/thedodd/trunk/releases/download/${VERSION}/trunk-x86_64-unknown-linux-gnu.tar.gz | tar -xzf-
env:
VERSION: "v0.16.0"
- name: Run trunk
run: ./trunk build --release --public-url /maiden
- name: Run deploy
run: GIT_DEPLOY_DIR=./static/dist ./deploy.sh