Skip to content

Commit f2f3cdb

Browse files
committed
Init Github actions
1 parent 9615e56 commit f2f3cdb

File tree

2 files changed

+74
-0
lines changed

2 files changed

+74
-0
lines changed

.github/workflows/format.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: "Run Format"
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
# Check formatting with rustfmt
10+
jobs:
11+
format:
12+
name: cargo fmt
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v4
16+
17+
- name: Cache Cargo dependencies
18+
uses: actions/cache@v4
19+
with:
20+
path: |
21+
~/.cargo/bin/
22+
~/.cargo/registry/index/
23+
~/.cargo/registry/cache/
24+
~/.cargo/git/db/
25+
target/
26+
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
27+
28+
- name: Set up Rust toolchain
29+
uses: actions-rust-lang/setup-rust-toolchain@v1
30+
with:
31+
components: rustfmt
32+
toolchain: 1.83
33+
34+
- name: Rustfmt Check
35+
uses: actions-rust-lang/rustfmt@v1

.github/workflows/test.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: "Run Tests"
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
test:
11+
name: cargo test
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v4
15+
16+
- name: Cache Cargo dependencies
17+
uses: actions/cache@v4
18+
with:
19+
path: |
20+
~/.cargo/bin/
21+
~/.cargo/registry/index/
22+
~/.cargo/registry/cache/
23+
~/.cargo/git/db/
24+
target/
25+
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
26+
27+
- name: Set up Rust tool chain
28+
uses: actions-rust-lang/setup-rust-toolchain@v1
29+
with:
30+
toolchain: 1.83
31+
32+
- name: Add wasm32-wasi target
33+
run: rustup target add wasm32-wasip1
34+
35+
- name: Setup Viceroy
36+
run: cargo install viceroy
37+
38+
- name: Run tests
39+
run: cargo test

0 commit comments

Comments
 (0)