Skip to content

Commit

Permalink
Add CI
Browse files Browse the repository at this point in the history
  • Loading branch information
jdkaplan committed May 14, 2024
1 parent c141f55 commit 6538a75
Show file tree
Hide file tree
Showing 6 changed files with 91 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[alias]
deny = ["bin", "cargo-deny"]
17 changes: 17 additions & 0 deletions .github/workflows/dependencies.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: dependencies

on:
pull_request:
paths:
- '**/Cargo.lock'
- '**/Cargo.toml'

jobs:
cargo-deny:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: EmbarkStudios/cargo-deny-action@v1
with:
command: check bans licenses sources
53 changes: 53 additions & 0 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: pull_request

on:
pull_request:
merge_group:
types:
- checks_requested
push:
branches:
- main

env:
SQLX_OFFLINE: true

jobs:
format:
name: format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: dtolnay/[email protected]
with:
components: rustfmt

- run: cargo fmt --all --check

lint:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: dtolnay/[email protected]
with:
components: clippy

- uses: Swatinem/rust-cache@v2

- run: cargo clippy --workspace --all-targets

test:
name: test
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- uses: dtolnay/[email protected]

- uses: Swatinem/rust-cache@v2

- run: cargo test --workspace --no-fail-fast
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
/.bin
/target
3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,6 @@ opt-level = 3

[profile.dev.package.similar]
opt-level = 3

[package.metadata.bin]
cargo-deny = { version = "0.14.23" }
15 changes: 15 additions & 0 deletions deny.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[licenses]
version = 2

# Require extra-high confidence. Default was 0.8
confidence-threshold = 0.93
allow = [
"Apache-2.0",
"BlueOak-1.0.0",
"MIT",
"Unicode-DFS-2016",
"Zlib",
]

[bans]
wildcards = "warn"

0 comments on commit 6538a75

Please sign in to comment.