Skip to content

Commit

Permalink
Merge pull request #36 from ErichDonGubler/ci
Browse files Browse the repository at this point in the history
build(ci): add some simple CI for `cargo {check,deny,fmt,test}`
  • Loading branch information
ErichDonGubler authored Oct 27, 2023
2 parents 44e58a0 + 574b1c7 commit 30e464e
Show file tree
Hide file tree
Showing 6 changed files with 237 additions and 82 deletions.
11 changes: 11 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: CI (PR)

on: [pull_request]
jobs:
block-autosquash-commits:
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- name: Block merging fixup commits
uses: ErichDonGubler/block-fixup-merge-action@patch-1

112 changes: 112 additions & 0 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
name: CI (push)

on: [push]

jobs:
check:
name: Check
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
rust:
- stable
- beta
steps:
- name: Checkout sources
uses: actions/checkout@v1

- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.rust }}
override: true

- name: "Run `cargo check`"
uses: actions-rs/cargo@v1
with:
command: check

test:
name: Test Suite
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
rust:
- stable
- beta
steps:
- name: Checkout sources
uses: actions/checkout@v1

- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.rust }}
override: true

- name: "Run `cargo test`"
uses: actions-rs/cargo@v1
with:
command: test

fmt:
name: Rustfmt
runs-on: ${{ matrix.os }}
strategy:
matrix:
rust:
- stable
steps:
- name: Checkout sources
uses: actions/checkout@v1

- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.rust }}
override: true
components: rustfmt

- name: "Run `cargo fmt`"
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check

clippy:
name: Clippy
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
rust:
- stable
- beta
steps:
- name: Checkout sources
uses: actions/checkout@v1

- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.rust }}
override: true
components: clippy

- name: "Run `cargo clippy`"
uses: actions-rs/cargo@v1
with:
command: clippy
args: -- -D warnings

cargo-deny:
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- uses: EmbarkStudios/cargo-deny-action@v1
with:
log-level: warn
command: check
arguments: --all-features
8 changes: 8 additions & 0 deletions deny.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[licenses]
allow = [
"Apache-2.0",
"ISC",
"MIT",
"Unicode-DFS-2016",
"Zlib",
]
1 change: 1 addition & 0 deletions src/bin/moz-webgpu-cts/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ fn run(cli: Cli) -> ExitCode {
Subcommand::Triage => {
#[derive(Debug)]
struct TaggedTest {
#[allow(unused)]
orig_path: Arc<PathBuf>,
inner: metadata::Test,
}
Expand Down
Loading

0 comments on commit 30e464e

Please sign in to comment.