diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 0b4582b..2b3f484 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -12,13 +12,9 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - name: install cargo-release - uses: taiki-e/install-action@v2 - with: - tool: cargo-release@0.24 - - name: login - run: cargo login "$CARGO_AUTH_KEY" + - uses: taiki-e/install-action@cargo-release + - uses: taiki-e/install-action@cargo-make + - run: cargo login "$CARGO_AUTH_KEY" env: CARGO_AUTH_KEY: ${{ secrets.CARGO_AUTH_KEY }} - - name: publish - run: cargo release publish --no-confirm --allow-branch "*" --workspace --all-features --execute + - run: cargo make release diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index aca7a9d..805c699 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,14 +13,11 @@ jobs: steps: - uses: actions/checkout@v4 - uses: Swatinem/rust-cache@v2 - - name: cargo fmt check - run: cargo fmt --all -- --check - - name: Clippy - run: cargo clippy --workspace --all-features -- -D warnings - - name: Build docs - run: cargo doc --document-private-items --workspace --all-features --no-deps - env: - RUSTDOCFLAGS: -Dwarnings + - uses: taiki-e/install-action@cargo-make + - run: cargo make fmt-check + - run: cargo make clippy + - run: cargo make docs + test: # Avoid duplicate jobs on PR from a branch on the same repo if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name @@ -28,8 +25,8 @@ jobs: steps: - uses: actions/checkout@v4 - uses: Swatinem/rust-cache@v2 - - name: Run tests - run: cargo test --all-features + - uses: taiki-e/install-action@cargo-make + - run: cargo make test alls-green: if: always() && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name) diff --git a/Makefile.toml b/Makefile.toml index c08861c..ba56ab8 100644 --- a/Makefile.toml +++ b/Makefile.toml @@ -15,97 +15,27 @@ args = [ "@@split(CARGO_MAKE_CARGO_BUILD_TEST_FLAGS, )", ] -[tasks.test] -command = "cargo" -args = ["test"] -dependencies = ["build"] - -[tasks.lint] -description = "Run lint" -command = "cargo" -args = ["clippy", "--all-targets", "--all-features"] - -### with cargo-limit installed -[tasks.lbuild] -description = "Runs the rust compiler." -category = "Build" -install_crate = false -command = "cargo" -args = [ - "lbuild", - "@@remove-empty(CARGO_MAKE_CARGO_VERBOSE_FLAGS)", - "@@split(CARGO_MAKE_CARGO_BUILD_TEST_FLAGS, )", -] - -[tasks.ltest] -dependencies = ["ltest-blocking", "ltest-async"] - -[tasks.ltest-blocking] -command = "cargo" -args = ["ltest", "--no-default-features", "--features", "blocking"] -dependencies = ["lbuild"] - -[tasks.ltest-async] -command = "cargo" -args = ["ltest", "--no-default-features", "--features", "async"] -dependencies = ["lbuild"] - -[tasks.clean] -command = "cargo" -args = ["clean"] - -[tasks.format-ci] -description = "Runs the cargo rustfmt plugin during CI." +[tasks.fmt-check] +description = "Runs the cargo rustfmt plugin to check everything is well formatted" command = "cargo" args = ["fmt", "--all", "--", "--check"] -[tasks.clippy-ci] -command = "cargo" -args = ["clippy", "--", "-D", "warnings"] - -[tasks.build-ci] -description = "Build inside CI." +[tasks.test] command = "cargo" -args = ["build", "-j", "2"] - -[tasks.cache-cleanup] -description = "Clean CI cache" -dependencies = ["cargo-prune", "sweep", "delete-artifacts"] - -[tasks.sweep] -description = "Clean cargo cache with sweep" -command = "cargo sweep -t 10" -ignore_errors = true +args = ["test", "${@}", "--all-features"] -[tasks.cargo-prune] -description = "Run cargo prune" +[tasks.clippy] +description = "Run clippy" command = "cargo" -args = ["prune"] +args = ["clippy", "--all-targets", "--all-features", "--", "-D", "warnings"] -[tasks.delete-artifacts] -description = "Remove non cachable artifacts" -script = [ -''' -#!/bin/bash -set -e -set -x -find ./target/debug -type f -maxdepth 1 -delete || true -rm -rfv ./target/{debug,release}/deps/{*positional*} -rm -rfv ./target/{debug,release}/.fingerprint/*positional* -''' -] - -[tasks.sweep-start] -description = "Start cargo sweep" +[tasks.docs] +description = "Build docs as they are rendered on docs.rs" command = "cargo" -args = ["sweep", "-s"] +args = ["doc", "--document-private-items", "--all-features", "--no-deps"] +env = { "RUSTDOCFLAGS" = "-Dwarnings" } -[tasks.sweep-end] -description = "Run cargo sweep cleanup" +[tasks.release] +description = "Task to release the package to crates.io" command = "cargo" -args = ["sweep", "-f"] - -[tasks.print-stats] -description = "Print cache size" -command = "du" -args = ["-sh", "target", ".cargo"] +args = ["release", "publish", "--no-confirm", "--allow-branch \"*\"", "--all-features", "--execute"] \ No newline at end of file