From e53fef30d5eb4c9037f36447bee96248e179bb43 Mon Sep 17 00:00:00 2001 From: Alfan Nur Fauzan Date: Wed, 18 Jan 2023 22:01:44 +0700 Subject: [PATCH 1/4] redefine ci workflow --- .github/workflows/ci.yml | 26 +++++++++----------------- 1 file changed, 9 insertions(+), 17 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6b955b2..38a9d51 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,33 +1,25 @@ -name: Cargo Build & Test +name: Continuous Integration on: push -env: - CARGO_TERM_COLOR: always - jobs: - build_and_test: - name: Rust project - latest + test: runs-on: ubuntu-latest - strategy: - matrix: - toolchain: - - stable - - beta - - nightly steps: - uses: actions/checkout@v3 - - run: rustup update ${{ matrix.toolchain }} && rustup default ${{ matrix.toolchain }} - - run: cargo build --verbose - - run: cargo test --verbose + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + - uses: actions-rs/cargo@v1 + with: + command: test lint: - name: Lint runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - uses: actions-rs/toolchain@v1 with: - toolchain: stable + profile: minimal components: clippy - uses: actions-rs/clippy-check@v1 with: From 8064f56dafcfbc64a0860317466e4ebffa9522be Mon Sep 17 00:00:00 2001 From: Alfan Nur Fauzan Date: Wed, 18 Jan 2023 22:02:55 +0700 Subject: [PATCH 2/4] bring back toolchain --- .github/workflows/ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 38a9d51..60d7a5b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,6 +9,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions-rs/toolchain@v1 with: + toolchain: stable profile: minimal - uses: actions-rs/cargo@v1 with: @@ -19,6 +20,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions-rs/toolchain@v1 with: + toolchain: stable profile: minimal components: clippy - uses: actions-rs/clippy-check@v1 From 949f9075251aec6448e7b0c3cc88d95fb5a45159 Mon Sep 17 00:00:00 2001 From: Alfan Nur Fauzan Date: Wed, 18 Jan 2023 22:09:29 +0700 Subject: [PATCH 3/4] merge into one job --- .github/workflows/ci.yml | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 60d7a5b..8e56948 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -3,7 +3,7 @@ name: Continuous Integration on: push jobs: - test: + rust-ci: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 @@ -11,18 +11,16 @@ jobs: with: toolchain: stable profile: minimal - - uses: actions-rs/cargo@v1 + components: clippy + - name: Lint + uses: actions-rs/clippy-check@v1 with: - command: test - lint: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: actions-rs/toolchain@v1 + token: ${{ secrets.GITHUB_TOKEN }} + - name: Test + uses: actions-rs/cargo@v1 with: - toolchain: stable - profile: minimal - components: clippy - - uses: actions-rs/clippy-check@v1 + command: test + - name: Security audit + uses: actions-rs/audit-check@v1 with: token: ${{ secrets.GITHUB_TOKEN }} From 65c72e1787a638bf59c17edd8edd1907d68059d5 Mon Sep 17 00:00:00 2001 From: Alfan Nur Fauzan Date: Wed, 18 Jan 2023 22:14:08 +0700 Subject: [PATCH 4/4] refactor --- .github/workflows/ci.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8e56948..c04b20d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,12 +7,13 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - uses: actions-rs/toolchain@v1 + - name: Get stable toolchain with clippy + uses: actions-rs/toolchain@v1 with: - toolchain: stable profile: minimal + toolchain: stable components: clippy - - name: Lint + - name: Annotate commit with clippy warnings uses: actions-rs/clippy-check@v1 with: token: ${{ secrets.GITHUB_TOKEN }}