From 0a4b2f359d852d03018ba1acd0e5afb16bb5b135 Mon Sep 17 00:00:00 2001 From: Ruslan Pislari Date: Tue, 11 Jun 2024 19:35:44 +0300 Subject: [PATCH] fix: fix github pipeline --- .github/actions-rs/grcov.yml | 1 - .github/workflows/cd.yaml | 11 ++--- .github/workflows/ci.yaml | 84 +++++++++++++----------------------- 3 files changed, 34 insertions(+), 62 deletions(-) delete mode 100644 .github/actions-rs/grcov.yml diff --git a/.github/actions-rs/grcov.yml b/.github/actions-rs/grcov.yml deleted file mode 100644 index c0bfe1b..0000000 --- a/.github/actions-rs/grcov.yml +++ /dev/null @@ -1 +0,0 @@ -output-type: html \ No newline at end of file diff --git a/.github/workflows/cd.yaml b/.github/workflows/cd.yaml index 5a69e7f..a8f0df8 100644 --- a/.github/workflows/cd.yaml +++ b/.github/workflows/cd.yaml @@ -21,16 +21,13 @@ jobs: submodules: recursive - name: Setup Rust - uses: actions-rs/toolchain@v1 + uses: dtolnay/rust-toolchain@stable with: - profile: minimal - toolchain: stable + target: wasm32-wasi + components: rustfmt, clippy - name: Release build - uses: actions-rs/cargo@v1 - with: - command: build - args: --release --bin cli + run: cargo build --release - name: Upload target binary uses: actions/upload-artifact@v4 diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 5f9d3cd..3315b91 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -4,6 +4,7 @@ on: [ push ] env: CARGO_TERM_COLOR: always + RUSTFLAGS: "-Dwarnings" jobs: build: @@ -17,67 +18,42 @@ jobs: submodules: recursive - name: Setup Rust - uses: actions-rs/toolchain@v1 + uses: dtolnay/rust-toolchain@stable with: - profile: minimal - toolchain: stable + target: wasm32-wasi components: rustfmt, clippy - - name: Release build - uses: actions-rs/cargo@v1 + - name: Run cargo-audit binary crate + uses: rustsec/audit-check@v1.4.1 with: - command: build - args: --release --all-features + token: ${{ secrets.GITHUB_TOKEN }} - - name: Install cargo-audit binary crate - uses: actions-rs/install@v0.1 - with: - crate: cargo-audit - version: latest - use-tool-cache: true + - name: Release Build + run: cargo build --release --all-features - - name: Annotate commit with clippy warnings - uses: actions-rs/clippy-check@v1 + - name: Run Clippy + run: cargo clippy --all-targets --all-features + + release: + runs-on: ubuntu-latest + if: github.ref == 'refs/heads/main' + needs: build + steps: + - name: Clone repo + uses: actions/checkout@v4 with: - token: ${{ secrets.GITHUB_TOKEN }} - args: --all-features + submodules: recursive - - name: Security audit - uses: actions-rs/audit-check@v1 + - name: Setup Rust + uses: dtolnay/rust-toolchain@stable with: - token: ${{ secrets.GITHUB_TOKEN }} + target: wasm32-wasi + components: rustfmt, clippy -# coverage: -# needs: build -# runs-on: ubuntu-latest -# if: github.ref != 'refs/heads/main' -# steps: -# - name: Clone repo -# uses: actions/checkout@v4 -# with: -# submodules: recursive -# -# - uses: actions-rs/toolchain@v1 -# with: -# toolchain: nightly -# override: true -# -# - uses: actions-rs/cargo@v1 -# name: Run test with code coverage report -# with: -# command: test -# args: --workspace --all-features --no-fail-fast -# env: -# CARGO_INCREMENTAL: '0' -# RUSTFLAGS: '-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests' -# RUSTDOCFLAGS: '-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests' -# -# - id: coverage -# name: Collect code coverage -# uses: actions-rs/grcov@v0.1 -# -# - name: Archive code coverage results -# uses: actions/upload-artifact@v4 -# with: -# name: code-coverage-report -# path: ${{ steps.coverage.outputs.report }} \ No newline at end of file + - name: Run Release PR + uses: MarcoIeni/release-plz-action@v0.5 + with: + command: release + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} \ No newline at end of file