Skip to content

Commit c98679d

Browse files
committed
Add CI
Signed-off-by: Jorge Prendes <jorge.prendes@gmail.com>
1 parent c9abf27 commit c98679d

12 files changed

Lines changed: 1901 additions & 1 deletion

File tree

.github/workflows/ci.yml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# yaml-language-server: $schema=https://json.schemastore.org/github-action.json
2+
3+
name: CI
4+
5+
on:
6+
push:
7+
branches: [main]
8+
pull_request:
9+
branches: [main]
10+
11+
env:
12+
CARGO_TERM_COLOR: always
13+
14+
jobs:
15+
run-tests:
16+
name: Run tests on ${{ matrix.os }}
17+
strategy:
18+
matrix:
19+
os: ["ubuntu-latest", "windows-latest"]
20+
runs-on: ${{ matrix.os }}
21+
steps:
22+
- uses: actions/checkout@v4
23+
- uses: actions-rust-lang/setup-rust-toolchain@v1
24+
- uses: Swatinem/rust-cache@v2
25+
- name: Install cargo-hyperlight
26+
shell: bash
27+
run: cargo install cargo-hyperlight --path .
28+
- name: Build guest demo
29+
shell: bash
30+
run: |
31+
cargo hyperlight build --manifest-path demo/guest/Cargo.toml
32+
- name: Run demo
33+
shell: bash
34+
run: cargo run --manifest-path demo/host/Cargo.toml -- src/guest/target/x86_64-hyperlight-none/debug/guest
35+
36+
spelling:
37+
name: Spell check with typos
38+
runs-on: ubuntu-latest
39+
steps:
40+
- uses: actions/checkout@v4
41+
- name: Spell Check Repo
42+
uses: crate-ci/typos@master
43+
44+
check:
45+
name: Lint on ${{ matrix.os }}
46+
strategy:
47+
matrix:
48+
os: ["ubuntu-latest", "windows-latest"]
49+
runs-on: ${{ matrix.os }}
50+
steps:
51+
- uses: actions/checkout@v4
52+
- uses: actions-rust-lang/setup-rust-toolchain@v1
53+
with:
54+
components: rustfmt, clippy
55+
- name: Setup nightly toolchain
56+
shell: bash
57+
run: rustup toolchain install nightly --component rustfmt # needed to run rustfmt in nightly toolchain
58+
- name: Check formatting
59+
shell: bash
60+
run: cargo +nightly fmt -- --check
61+
- name: Check clippy
62+
shell: bash
63+
run: cargo clippy -- -D warnings

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
/target
2+
/demo/*/target

0 commit comments

Comments
 (0)