From 95b0a6dd40cb3dc478529c250821591032dbd301 Mon Sep 17 00:00:00 2001 From: Paul Campbell Date: Tue, 3 Dec 2024 06:46:50 +0000 Subject: [PATCH] build: upgrade kemitix/rust v3 --- .forgejo/workflows/push-main.yml | 38 +++++++++++++++++++++++++ .forgejo/workflows/push-next.yml | 48 +++++++++++++++++--------------- .gitignore | 1 + Cargo.toml | 1 + src/main.rs | 1 + 5 files changed, 67 insertions(+), 22 deletions(-) create mode 100644 .forgejo/workflows/push-main.yml diff --git a/.forgejo/workflows/push-main.yml b/.forgejo/workflows/push-main.yml new file mode 100644 index 0000000..c073b30 --- /dev/null +++ b/.forgejo/workflows/push-main.yml @@ -0,0 +1,38 @@ +name: Release Please + +permissions: + pull-requests: write + contents: write + +on: + push: + branches: + - main + +env: + CARGO_TERM_COLOR: always + +jobs: + release-plz: + name: Release-plz + runs-on: docker + + container: + image: + git.kemitix.net/kemitix/rust:v3.0.0 + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Run release-plz release-pr + run: release-plz release-pr --backend gitea --git-token ${{ secrets.FORGEJO_TOKEN }} + env: + CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} + + - name: Run release-plz release + run: release-plz release --backend gitea --git-token ${{ secrets.FORGEJO_TOKEN }} + env: + CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} diff --git a/.forgejo/workflows/push-next.yml b/.forgejo/workflows/push-next.yml index 552632e..e573ec5 100644 --- a/.forgejo/workflows/push-next.yml +++ b/.forgejo/workflows/push-next.yml @@ -1,10 +1,13 @@ -name: Rust +name: Test on: push: - branches: ["next"] + branches: + - next pull_request: - branches: ["main"] + branches: + - main + workflow_dispatch: env: CARGO_TERM_COLOR: always @@ -12,7 +15,11 @@ env: jobs: build: runs-on: docker - + + container: + image: + git.kemitix.net/kemitix/rust:v3.0.0 + strategy: matrix: toolchain: @@ -23,30 +30,27 @@ jobs: - name: Checkout uses: actions/checkout@v4 - - name: Format - uses: https://git.kemitix.net/kemitix/rust@v2.6.0 - with: - args: ${{ matrix.toolchain.name }} cargo fmt --all -- --check + - name: Check TODOs + uses: https://git.kemitix.net/kemitix/forgejo-todo-checker@v1.3.0 - # - name: Machete - # uses: https://github.com/bnjbvr/cargo-machete@v0.6.2 + - name: Machete + run: cargo +${{ matrix.toolchain.name }} machete + + - name: Format + run: cargo +${{ matrix.toolchain.name }} fmt --all --check - name: Clippy - uses: https://git.kemitix.net/kemitix/rust@v2.6.0 - with: - args: ${{ matrix.toolchain.name }} cargo clippy + run: cargo +${{ matrix.toolchain.name }} hack --feature-powerset clippy - name: Build - uses: https://git.kemitix.net/kemitix/rust@v2.6.0 - with: - args: ${{ matrix.toolchain.name }} cargo build + run: cargo +${{ matrix.toolchain.name }} hack --feature-powerset build - name: Test - uses: https://git.kemitix.net/kemitix/rust@v2.6.0 - with: - args: ${{ matrix.toolchain.name }} cargo test --no-fail-fast + run: cargo +${{ matrix.toolchain.name }} hack --feature-powerset test - name: Integration - uses: https://git.kemitix.net/kemitix/rust@v2.6.0 - with: - args: ./test.sh + run: ./test.sh + + - name: Mutations + run: cargo +${{ matrix.toolchain.name }} mutants -vV --in-place + diff --git a/.gitignore b/.gitignore index 57556c0..af5a7c4 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ /target +mutants-out*/ dist/ input.txt diff --git a/Cargo.toml b/Cargo.toml index ec6ed3f..391b7eb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -15,3 +15,4 @@ exclude = [".cargo_home"] [dependencies] clap = { version = "4.5", features = ["derive"] } +mutants = "0.0" diff --git a/src/main.rs b/src/main.rs index 4eb8e7c..9a2a97b 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,6 +1,7 @@ use clap::Parser; use skip::{skip, Cli, Result}; +#[cfg_attr(test, mutants::skip)] fn main() -> Result<()> { let cli = Cli::parse(); let mut stdout = std::io::stdout();