Skip to content

Commit

Permalink
Add cargo deny, cargo clippy (#50)
Browse files Browse the repository at this point in the history
* Add deny.toml file

* Run cargo update

* Update license list

* Add Audit workflow for cargo deny

* Run clippy through reviewdog

* Change names of workflows and tasks

Include audit.yml in paths to monitor

* Resolve clippy

* Add codeowners file for Rust cli related projects

* Resolve cargo deny issues

* Add fpx to alias
  • Loading branch information
hatchan authored Jun 21, 2024
1 parent d3ba93f commit cef2cc6
Show file tree
Hide file tree
Showing 8 changed files with 235 additions and 294 deletions.
1 change: 1 addition & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
[alias]
fpx = "run --package fpx --"
xtask = "run --package xtask --"
9 changes: 9 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Rust cli related files
fpx @fiberplane/fpx-cli-devs
xtask @fiberplane/fpx-cli-devs
Cargo.* @fiberplane/fpx-cli-devs
.cargo @fiberplane/fpx-cli-devs
deny.toml @fiberplane/fpx-cli-devs

# Workflow related files
.github @fiberplane/infrastructure-devs
28 changes: 28 additions & 0 deletions .github/workflows/audit.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
name: Audit

on:
push:
branches: ["**"]

paths:
- "**/Cargo.toml"
- "**/Cargo.lock"
- "**/deny.toml"
- ".github/workflows/audit.yaml"

schedule:
- cron: "23 1 * * *"

workflow_dispatch:

jobs:
audit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: recursive

- uses: EmbarkStudios/cargo-deny-action@v1
12 changes: 10 additions & 2 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Test and build the project.
---
name: Build API
name: Build

on:
# Allow manual trigger
Expand All @@ -15,7 +15,7 @@ on:
branches: ["main"]

jobs:
build-rust:
build:
strategy:
matrix:
include:
Expand Down Expand Up @@ -43,8 +43,16 @@ jobs:
- name: Install Rust
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
components: clippy
rustflags: "" # Do not fail on warnings, so reset the default value to empty

- uses: giraffate/clippy-action@v1
with:
reporter: github-pr-check
filter_mode: nofilter
fail_on_error: true
clippy_flags: --all-features --no-deps

- name: cargo test
run: cargo test

Expand Down
Loading

0 comments on commit cef2cc6

Please sign in to comment.