forked from wasi-gfx/wasi-gfx-runtime
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: integrate automated tests for PRs
Signed-off-by: shamb0 <[email protected]>
- Loading branch information
Showing
2 changed files
with
99 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
branches: ["*"] | ||
tags: [v0.*] | ||
pull_request: | ||
merge_group: | ||
|
||
jobs: | ||
check: | ||
timeout-minutes: 30 | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
include: | ||
# Linux | ||
- name: Linux x86_64 | ||
os: ubuntu-22.04 | ||
target: x86_64-unknown-linux-gnu | ||
kind: native | ||
|
||
name: Clippy ${{ matrix.name }} | ||
runs-on: ${{ matrix.os }} | ||
|
||
steps: | ||
- name: checkout repo | ||
uses: actions/checkout@v2 | ||
- name: Install Rust | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
override: true | ||
components: rustfmt, clippy | ||
- name: Workspace Check | ||
run: cargo check --workspace | ||
- name: Check formatting | ||
run: cargo fmt --all -- --check | ||
- name: Cargo clippy | ||
run: cargo clippy --workspace --all-targets | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
name: Run Automated Tests | ||
|
||
on: | ||
push: | ||
branches: ["*"] | ||
tags: [v0.*] | ||
pull_request: | ||
merge_group: | ||
|
||
env: | ||
# | ||
# Environment variables | ||
# | ||
CARGO_INCREMENTAL: false | ||
CARGO_TERM_COLOR: always | ||
RUST_LOG: info | ||
RUST_BACKTRACE: full | ||
RUSTFLAGS: -D warnings | ||
RUSTDOCFLAGS: -D warnings | ||
IT_TEST_TIMEOUT: 30 # 30 sec | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-22.04 | ||
strategy: | ||
matrix: | ||
command: | ||
- 'cargo xtask run-demo --name skybox' | ||
- 'cargo xtask run-demo --name triangle' | ||
- 'cargo xtask run-demo --name rectangle_simple_buffer' | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Install Rust | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
override: true | ||
|
||
- name: Install Repo toolchain | ||
run: | | ||
rustup target add wasm32-unknown-unknown | ||
cargo install cargo-xtask | ||
cargo install wasm-tools | ||
cargo install wit-deps-cli | ||
- name: Run demo | ||
run: | | ||
timeout ${{ env.IT_TEST_TIMEOUT }} ${{ matrix.command }} || echo "Command ${{ matrix.command }} failed" | ||
- name: Report results | ||
if: failure() | ||
run: echo "One or more commands failed" | ||
|