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

build(ci): add some simple CI for cargo {check,deny,fmt,test} #36

Merged
merged 4 commits into from
Oct 27, 2023
Merged
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
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