Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: integrate automated tests for PRs #41

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"