-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
144 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
use nix |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
name: Linting | ||
on: [push, pull_request] | ||
|
||
jobs: | ||
cargo-deny: | ||
name: Cargo dependency linting | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: EmbarkStudios/cargo-deny-action@v1 | ||
clippy: | ||
name: Clippy linting | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: nightly | ||
components: clippy | ||
override: true | ||
- uses: actions-rs/clippy-check@v1 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
args: --all-features | ||
name: Clippy Output | ||
fmt: | ||
name: Check formatting | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
profile: minimal | ||
toolchain: nightly | ||
components: rustfmt | ||
override: true | ||
- uses: actions-rs/cargo@v1 | ||
with: | ||
command: fmt | ||
args: --all -- --check |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
name: Testing | ||
on: [push, pull_request] | ||
|
||
jobs: | ||
test: | ||
name: Run tests | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
rust: | ||
- nightly | ||
- stable | ||
- 1.60.0 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
profile: minimal | ||
toolchain: ${{ matrix.rust }} | ||
override: true | ||
- uses: actions-rs/cargo@v1 | ||
with: | ||
command: test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"nixEnvSelector.nixFile": "${workspaceRoot}/shell.nix" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
# More information: https://embarkstudios.github.io/cargo-deny/index.html | ||
targets = [ | ||
{ triple = "x86_64-unknown-linux-gnu" }, | ||
{ triple = "aarch64-unknown-linux-gnu" }, | ||
{ triple = "x86_64-unknown-linux-musl" }, | ||
{ triple = "aarch64-apple-darwin" }, | ||
{ triple = "x86_64-apple-darwin" }, | ||
{ triple = "x86_64-pc-windows-msvc" }, | ||
] | ||
|
||
[advisories] | ||
db-path = "~/.cargo/advisory-db" | ||
db-urls = ["https://github.com/rustsec/advisory-db"] | ||
|
||
vulnerability = "deny" | ||
unmaintained = "warn" | ||
yanked = "warn" | ||
notice = "warn" | ||
|
||
[licenses] | ||
allow = [ | ||
"MIT", | ||
"Apache-2.0", | ||
"BSD-3-Clause", | ||
"Unicode-DFS-2016" | ||
] | ||
|
||
# Deny all unlicensed, copyleft and other not explicitly allowed licenses | ||
unlicensed = "deny" | ||
copyleft = "deny" | ||
allow-osi-fsf-free = "neither" | ||
default = "deny" | ||
|
||
# Some crates require weird licenses, exceptions for those crates can be made here | ||
exceptions = [] | ||
|
||
# The confidence threshold for detecting a license from license text. | ||
# The higher the value, the more closely the license text must be to the | ||
# canonical license text of a valid SPDX license file. | ||
confidence-threshold = 0.8 | ||
|
||
[bans] | ||
multiple-versions = "warn" | ||
wildcards = "allow" | ||
highlight = "all" | ||
|
||
[sources] | ||
unknown-registry = "deny" | ||
unknown-git = "deny" | ||
|
||
allow-registry = ["https://github.com/rust-lang/crates.io-index"] | ||
allow-git = [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
edition = "2021" | ||
use_field_init_shorthand = true | ||
use_try_shorthand = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{ pkgs ? import <nixpkgs> { } }: | ||
|
||
let | ||
rust-overlay = (import (builtins.fetchTarball "https://github.com/oxalica/rust-overlay/archive/master.tar.gz")); | ||
pkgs = (import <nixpkgs> { | ||
overlays = [ rust-overlay ]; | ||
}); | ||
in | ||
pkgs.mkShell { | ||
buildInputs = [ | ||
(pkgs.rust-bin.stable.latest.default.override { | ||
extensions = [ "rust-src" ]; | ||
}) | ||
]; | ||
PKG_CONFIG_PATH = "${pkgs.openssl.dev}/lib/pkgconfig"; | ||
# nativeBuildInputs is usually what you want -- tools you need to run | ||
nativeBuildInputs = [ | ||
pkgs.pkg-config | ||
pkgs.rust-analyzer | ||
pkgs.cargo-deny | ||
]; | ||
} |