Add a test crate
This commit is contained in:
parent
f7df7c43b6
commit
5237226018
|
@ -3,3 +3,5 @@
|
||||||
*.log
|
*.log
|
||||||
tmp/
|
tmp/
|
||||||
result
|
result
|
||||||
|
result-doc
|
||||||
|
target
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
use flake
|
|
@ -0,0 +1,7 @@
|
||||||
|
# This file is automatically @generated by Cargo.
|
||||||
|
# It is not intended for manual editing.
|
||||||
|
version = 3
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "test-crate"
|
||||||
|
version = "0.1.0"
|
|
@ -0,0 +1,8 @@
|
||||||
|
[package]
|
||||||
|
name = "test-crate"
|
||||||
|
version = "0.1.0"
|
||||||
|
edition = "2021"
|
||||||
|
|
||||||
|
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||||
|
|
||||||
|
[dependencies]
|
|
@ -0,0 +1,26 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
###
|
||||||
|
## This script replicates the same steps as ci, except for cargo audit
|
||||||
|
###
|
||||||
|
|
||||||
|
# Turn on the guard rails
|
||||||
|
set -exuo pipefail
|
||||||
|
|
||||||
|
CRATE="test-crate"
|
||||||
|
|
||||||
|
## TODO use subshell magic to make a nice interface here
|
||||||
|
|
||||||
|
# Lint the formatting
|
||||||
|
nix build .#lints.format.$CRATE -L
|
||||||
|
# Audit it
|
||||||
|
nix develop -c cargo audit
|
||||||
|
# Run clippy
|
||||||
|
nix build .#lints.clippy.$CRATE -L
|
||||||
|
# Build it
|
||||||
|
nix build .#$CRATE -L
|
||||||
|
# Test it
|
||||||
|
nix develop -c cargo nextest run
|
||||||
|
nix develop -c cargo test --doc
|
||||||
|
# Document it
|
||||||
|
nix build .#docs.$CRATE.doc -L
|
|
@ -0,0 +1,10 @@
|
||||||
|
{
|
||||||
|
inputs = { rust = { url = "./.."; }; };
|
||||||
|
description = "Simple Test Package";
|
||||||
|
|
||||||
|
outputs = { self, nixpkgs, rust }:
|
||||||
|
rust.single {
|
||||||
|
crateName = "test-crate";
|
||||||
|
src = ./.;
|
||||||
|
};
|
||||||
|
}
|
|
@ -0,0 +1,2 @@
|
||||||
|
/// Doc comment
|
||||||
|
pub fn thing() {}
|
|
@ -0,0 +1,3 @@
|
||||||
|
fn main() {
|
||||||
|
println!("Hello, world!");
|
||||||
|
}
|
Loading…
Reference in New Issue