github: Clean up CI checks, and run clippy lints separately.

This commit is contained in:
parazyd
2021-12-19 21:02:35 +01:00
parent c2802713e1
commit 27a9a8f1bb
3 changed files with 66 additions and 35 deletions

43
.github/workflows/ci.yml vendored Normal file
View File

@@ -0,0 +1,43 @@
name: CI Checks
on: [push, pull_request]
jobs:
test:
name: Test on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- name: Install dependencies
run: |
sudo apt update
sudo apt -y install build-essential clang libclang-dev llvm-dev libudev-dev pkg-config
- name: Run tests
run: |
make test
fmt:
name: rustfmt
timeout-minutes: 30
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- run: rustup component add rustfmt
- uses: actions-rs/cargo@v1
with:
command: fmt
args: -- --check

23
.github/workflows/lints-stable.yml vendored Normal file
View File

@@ -0,0 +1,23 @@
name: Stable lints
# We only run these on trial-merges of PRs to reduce noise.
on: pull_request
jobs:
clippy:
name: Clippy (stable)
timeout-minutes: 30
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
components: clippy
override: true
- name: Run Clippy
uses: actions-rs/clippy-check@v1
with:
name: Clippy (stable)
token: ${{ secrets.GITHUB_TOKEN }}
args: --all-features --release -- -D warnings

View File

@@ -1,35 +0,0 @@
name: Build and Test
on: [push, pull_request]
jobs:
compile-and-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
components: rustfmt, clippy
- name: Install Dependencies
run: |
sudo apt update
sudo apt -y install build-essential clang libclang-dev llvm-dev libudev-dev pkg-config
- name: Create config directory
run: |
mkdir -p ~/.config/darkfi
- name: Test with all features
run: |
cargo test --release --all-features
- name: Clippy check
uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --release --all-features