Skip to content

Commit

Permalink
Add CI
Browse files Browse the repository at this point in the history
Add a workflow triggered on every push that runs cargo check, test, fmt
and clippy for default members.

That excludes dtrace-sys which is right because it depends on dtrace
which is not available on the GitHub Ubuntu runners and fails to compile
there.
  • Loading branch information
goodhoko authored Apr 21, 2023
1 parent a44c1ec commit 338c1c6
Showing 1 changed file with 60 additions and 0 deletions.
60 changes: 60 additions & 0 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# Runs cargo test, fmt and clippy on every push for default members.
# Based on https://github.com/actions-rs/meta/blob/master/recipes/quickstart.md

on: [push]

name: Validate

jobs:
test:
name: Run Tests
runs-on: ubuntu-latest
steps:
- name: Install native dependencies
run: sudo apt-get update && sudo apt-get install libasound2-dev

- name: Checkout sources
uses: actions/checkout@v2

- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true

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

lints:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Install native dependencies
run: sudo apt-get update && sudo apt-get install libasound2-dev

- name: Checkout sources
uses: actions/checkout@v2

- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
components: rustfmt, clippy

- name: Run cargo fmt
uses: actions-rs/cargo@v1
with:
command: fmt
## fmt doesn't compile the crates so we can include dtrace-sys with --all
args: --all --check

- name: Run cargo clippy
uses: actions-rs/cargo@v1
with:
command: clippy
args: --all-targets --all-features -- -D warnings

0 comments on commit 338c1c6

Please sign in to comment.