forked from trunk-rs/trunk
-
Notifications
You must be signed in to change notification settings - Fork 0
185 lines (163 loc) · 5.24 KB
/
ci.yaml
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
name: CI
on: [push, pull_request]
jobs:
lint:
name: lint
runs-on: ubuntu-latest
steps:
- name: Setup | Checkout
uses: actions/checkout@v2
- uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-lint
restore-keys: |
${{ runner.os }}-lint
- name: Setup | Toolchain (clippy)
uses: actions-rs/toolchain@v1
with:
toolchain: stable
default: true
components: clippy
- name: Build | Clippy
uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --all-targets
- name: Setup | Toolchain (rustfmt)
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
default: true
components: rustfmt
- name: Build | Rustfmt
run: cargo fmt -- --check
check:
runs-on: ubuntu-latest
steps:
- name: Setup | Checkout
uses: actions/checkout@v2
- name: Setup | Cache Cargo
uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-check
restore-keys: |
${{ runner.os }}-check
- name: Setup | Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
- name: Build | Check
run: cargo check --all
test:
needs: check # Ensure check is run first.
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
include:
- os: ubuntu-latest
binPath: target/debug/trunk
- os: macos-latest
binPath: target/debug/trunk
- os: windows-latest
binPath: target/debug/trunk.exe
runs-on: ${{ matrix.os }}
steps:
- name: Setup | Checkout
uses: actions/checkout@v2
- name: Setup | Cache Cargo
uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo
restore-keys: |
${{ runner.os }}-cargo
- name: Setup | Cache | Example proxy
uses: actions/cache@v2
with:
path: examples/proxy/target
key: wasm32-example-proxy
restore-keys: |
wasm32-example-proxy
- name: Setup | Cache | Example seed
uses: actions/cache@v2
with:
path: examples/seed/target
key: wasm32-example-seed
restore-keys: |
wasm32-example-seed
- name: Setup | Cache | Example vanilla
uses: actions/cache@v2
with:
path: examples/vanilla/target
key: wasm32-example-vanilla
restore-keys: |
wasm32-example-vanilla
- name: Setup | Cache | Example webworker
uses: actions/cache@v2
with:
path: examples/webworker/target
key: wasm32-example-webworker
restore-keys: |
wasm32-example-webworker
- name: Setup | Cache | Example webworker-gloo
uses: actions/cache@v2
with:
path: examples/webworker-gloo/target
key: wasm32-example-webworker-gloo
restore-keys: |
wasm32-example-webworker-gloo
- name: Setup | Cache | Example yew
uses: actions/cache@v2
with:
path: examples/yew/target
key: wasm32-example-yew
restore-keys: |
wasm32-example-yew
- name: Setup | Cache | Example yew-tailwindcss
uses: actions/cache@v2
with:
path: examples/yew-tailwindcss/target
key: wasm32-example-yew-tailwindcss
restore-keys: |
wasm32-example-yew-tailwindcss
- name: Setup | Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
target: wasm32-unknown-unknown
- name: Build | Test
run: cargo test
# Run the CLI to ensure we don't have any subtle runtime issues.
- name: Build | Run
run: cargo run -- -h
# Build examples via our newly built debug artifact.
- name: Build | Examples | proxy
run: ${{ matrix.binPath }} --config=examples/proxy/Trunk.toml build
- name: Build | Examples | seed
run: ${{ matrix.binPath }} --config=examples/seed/Trunk.toml build
- name: Build | Examples | vanilla
run: ${{ matrix.binPath }} --config=examples/vanilla/Trunk.toml build
- name: Build | Examples | webworker
run: ${{ matrix.binPath }} --config=examples/webworker/Trunk.toml build
- name: Build | Examples | webworker-gloo
run: ${{ matrix.binPath }} --config=examples/webworker-gloo/Trunk.toml build
- name: Build | Examples | yew
run: ${{ matrix.binPath }} --config=examples/yew/Trunk.toml build
- name: Build | Examples | yew-tailwindcss
run: ${{ matrix.binPath }} --config=examples/yew-tailwindcss/Trunk.toml build
- name: Build | Examples | no-rust
run: ${{ matrix.binPath }} --config=examples/no-rust/Trunk.toml build