Skip to content

Commit

Permalink
ci: integrate automated tests for PRs
Browse files Browse the repository at this point in the history
Signed-off-by: shamb0 <[email protected]>
  • Loading branch information
shamb0 committed Jun 27, 2024
1 parent 9e8aa7d commit 108eef2
Show file tree
Hide file tree
Showing 2 changed files with 99 additions and 0 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/ci.yml
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


56 changes: 56 additions & 0 deletions .github/workflows/run-automated-tests.yml
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"

0 comments on commit 108eef2

Please sign in to comment.