Skip to content

Commit b5c95c1

Browse files
committed
ci: init
Signed-off-by: Frank Yang <[email protected]>
1 parent 96516cd commit b5c95c1

File tree

1 file changed

+52
-0
lines changed

1 file changed

+52
-0
lines changed

.github/workflows/build.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
2+
3+
name: Rust
4+
on:
5+
pull_request:
6+
branches: [main]
7+
paths-ignore:
8+
- "README.md"
9+
env:
10+
CARGO_TERM_COLOR: always
11+
jobs:
12+
build:
13+
name: Build Spin
14+
runs-on: ${{ matrix.config.os }}
15+
strategy:
16+
matrix:
17+
config:
18+
- {
19+
os: "ubuntu-latest",
20+
platformAgnosticChecks: true,
21+
}
22+
- {
23+
os: "macos-latest",
24+
}
25+
steps:
26+
- uses: actions/checkout@v2
27+
28+
- name: Install latest Rust stable toolchain
29+
uses: actions-rs/toolchain@v1
30+
with:
31+
toolchain: stable
32+
default: true
33+
components: clippy, rustfmt
34+
35+
- name: "Install Wasm Rust target"
36+
run: rustup target add wasm32-wasi
37+
38+
- uses: Swatinem/rust-cache@v1
39+
40+
- name: Lint
41+
if: ${{ matrix.config.platformAgnosticChecks }}
42+
run:
43+
make lint
44+
45+
- name: Cargo Build
46+
run: cargo build --release
47+
48+
- name: Cargo Test
49+
run: |
50+
make test-unit
51+
env:
52+
RUST_LOG: spin=trace

0 commit comments

Comments
 (0)