Skip to content
This repository has been archived by the owner on Jul 27, 2023. It is now read-only.

Commit

Permalink
ci: update scripts
Browse files Browse the repository at this point in the history
Overhauling the ci scripts to split them into singular steps,
combining them in the run script.

Signed-off-by: Fintan Halpenny <[email protected]>
  • Loading branch information
FintanH committed Jan 20, 2022
1 parent ac7c9ee commit 2a07568
Show file tree
Hide file tree
Showing 10 changed files with 49 additions and 32 deletions.
8 changes: 8 additions & 0 deletions ci/advisory
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/usr/bin/env bash
set -eoux pipefail

cargo deny --version
cargo deny check advisories
cargo deny check licenses
cargo deny check bans
cargo deny check sources
5 changes: 5 additions & 0 deletions ci/build-test
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env bash
set -eoux pipefail

cargo build --workspace
GIT_FIXTURES=1 cargo test --workspace --features serialize
5 changes: 5 additions & 0 deletions ci/docs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env bash
set -eoux pipefail

RUSTDOCFLAGS="-D rustdoc::broken-intra-doc-links -D warnings" \
cargo doc --no-deps --workspace --document-private-items
4 changes: 4 additions & 0 deletions ci/fmt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env bash
set -eoux pipefail

cargo +nightly fmt -- --check
5 changes: 5 additions & 0 deletions ci/gh/build-test
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env bash
set -eoux pipefail

cargo build --workspace
GIT_FIXTURES=1 cargo test --workspace --features serialize --features gh-actions
4 changes: 4 additions & 0 deletions ci/lint
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env bash
set -eoux pipefail

cargo clippy --all-targets -- -D warnings
4 changes: 4 additions & 0 deletions ci/nix/fmt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env bash
set -eoux pipefail

cargo fmt -- --check
8 changes: 8 additions & 0 deletions ci/nix/run
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/usr/bin/env bash
set -eou pipefail

./ci/nix/fmt
./ci/lint
./ci/build-test
./ci/docs
./ci/advisory
36 changes: 5 additions & 31 deletions ci/run
Original file line number Diff line number Diff line change
@@ -1,34 +1,8 @@
#!/usr/bin/env bash
set -eou pipefail

echo '--- Formatting'
cargo fmt -- --check

echo '--- Clippy'
cargo clippy --all-targets --all-features -- -D warnings

if [[ "${CI:-false}" = "true" ]]
then
sed -i -e 's|db-path.*|db-path = "/cache/cargo/advisory-db"|' deny.toml
fi

echo '--- deny: Advisories'
cargo deny check advisories

echo '--- deny: Licenses'
cargo deny check licenses

echo '--- deny: Bans'
cargo deny check bans

echo '--- deny: Sources'
cargo deny check sources

echo '--- Build'
cargo build --verbose --workspace --all-features

echo '--- Build & Test'
GIT_FIXTURES=1 cargo test --workspace --all-features

echo '--- Docs'
cargo doc --no-deps
./ci/fmt
./ci/lint
./ci/build-test
./ci/docs
./ci/advisory
2 changes: 1 addition & 1 deletion deny.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# The path where the advisory database is cloned/fetched into
db-path = "~/cargo/advisory-db"
# The url of the advisory database to use
db-url = "https://github.com/rustsec/advisory-db"
db-urls = [ "https://github.com/rustsec/advisory-db" ]
# The lint level for security vulnerabilities
vulnerability = "deny"
# The lint level for unmaintained crates
Expand Down

0 comments on commit 2a07568

Please sign in to comment.