-
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.
This commit adds our standard Cargo-Make Makefile to the repository, adds an initial empty Cargo lockfile, and includes CI steps. chore: Add Makefile and CI Jobs
- Loading branch information
1 parent
ab17eab
commit c7390ae
Showing
3 changed files
with
148 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,49 @@ | ||
name: Rust | ||
|
||
on: | ||
push: | ||
|
||
env: | ||
CARGO_TERM_COLOR: always | ||
|
||
jobs: | ||
# This job installs Cargo Make and Cargo Nextest before running | ||
# the CI workflow using Cargo Make. Most of the time, it should | ||
# restore Cargo Make and other dependencies from cache. | ||
build: | ||
name: Validate Rust Build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout the Repo | ||
uses: actions/checkout@v4 | ||
|
||
- name: "Install Rust (Nightly)" | ||
uses: dtolnay/rust-toolchain@nightly | ||
with: | ||
components: rustfmt,clippy | ||
|
||
- name: "Install Rust (Stable)" | ||
uses: dtolnay/rust-toolchain@stable | ||
with: | ||
components: llvm-tools-preview,rustfmt,clippy | ||
|
||
- name: "Restore Rust Cache" | ||
uses: Swatinem/rust-cache@v2 | ||
|
||
- name: "Install Cargo Tools from Binaries." | ||
uses: "taiki-e/install-action@v2" | ||
with: | ||
tool: "cargo-tarpaulin,cargo-make,cargo-nextest,cargo-llvm-cov" | ||
|
||
- name: "Install Cargo Sort" | ||
uses: taiki-e/cache-cargo-install-action@v1 | ||
with: | ||
tool: cargo-sort | ||
|
||
- name: "Install Taplo CLI" | ||
uses: taiki-e/cache-cargo-install-action@v1 | ||
with: | ||
tool: taplo-cli | ||
|
||
- name: "Cargo Make" | ||
run: cargo make ci-flow |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,92 @@ | ||
[config] | ||
default_to_workspace = false | ||
|
||
[env] | ||
CARGO_MAKE_CLIPPY_ARGS = "-- --no-deps" | ||
CARGO_MAKE_COVERAGE_PROVIDER = "llvm-cov" | ||
|
||
[tasks.dev-test-flow] | ||
dependencies = [ | ||
"pre-build", | ||
"format-flow", | ||
"clippy-flow", | ||
"build", | ||
"post-build", | ||
"pre-docs", | ||
"docs", | ||
"post-docs", | ||
"test-flow", | ||
] | ||
|
||
[tasks.pre-build] | ||
dependencies = [ | ||
"sort-ci", | ||
"format-toml-conditioned-flow", | ||
"unused-dependencies-flow", | ||
] | ||
|
||
[tasks.ci-flow] | ||
dependencies = [ | ||
"pre-ci-flow", | ||
"print-env-flow", | ||
"pre-build", | ||
"check-format-flow", | ||
"clippy-flow", | ||
"build", | ||
"post-build", | ||
"pre-docs", | ||
"docs", | ||
"post-docs", | ||
"test-flow", | ||
"coverage-flow", | ||
"post-ci-flow", | ||
] | ||
|
||
[tasks.test] | ||
workspace = true | ||
description = "Run our test suite" | ||
command = "cargo" | ||
args = [ | ||
"nextest", | ||
"run", | ||
"--locked", | ||
"@@remove-empty(CARGO_MAKE_CARGO_VERBOSE_FLAGS)", | ||
"@@split(CARGO_MAKE_CARGO_BUILD_TEST_FLAGS, )" | ||
] | ||
|
||
[tasks.help] | ||
command = "cargo" | ||
description = "List help text for wack executable" | ||
category = "Development" | ||
args = [ | ||
"run", | ||
"@@remove-empty(CARGO_MAKE_CARGO_VERBOSE_FLAGS)", | ||
"@@split(CARGO_MAKE_CARGO_BUILD_TEST_FLAGS, )", | ||
"--", | ||
"--help" | ||
] | ||
|
||
[tasks.fmt] | ||
workspace = true | ||
alias = "format" | ||
|
||
[tasks.check-format] | ||
workspace = true | ||
|
||
[tasks.wc] | ||
description = "Calculate the LoC in src. Require tokei to be installed." | ||
category = "Development" | ||
command = "tokei" | ||
args = [ "." ] | ||
|
||
[tasks.sort-ci] | ||
description = "Assert that Cargo.toml is sorted. Requires cargo-sort to be installed." | ||
category = "Development" | ||
command = "cargo" | ||
args = ["sort", "--check"] | ||
|
||
[tasks.sort] | ||
description = "Sort Cargo.toml. Requires cargo-sort to be installed." | ||
category = "Development" | ||
command = "cargo" | ||
args = ["sort"] |