ci: unify CI workflow with one ending step (#860)

* ci: unify CI workflow with one ending step

* update PR template
This commit is contained in:
Clement Tsang 2022-10-30 19:20:41 -04:00 committed by GitHub
parent e3ced72c2f
commit 3296feae50
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 12 deletions

View File

@ -1,6 +1,6 @@
## Description
_A description of the change and what it does. If relevant (such as any change that modifies the UI), **please provide screenshots** of the change:_
_A description of the change, what it does, and why it was made. If relevant (such as any change that modifies the UI), **please provide screenshots** of the changes:_
## Issue

View File

@ -47,6 +47,7 @@ jobs:
supported:
needs: pre_job
runs-on: ${{ matrix.info.os }}
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
strategy:
fail-fast: false
matrix:
@ -70,11 +71,9 @@ jobs:
features: ["--all-features", "--no-default-features"]
steps:
- name: Checkout repository
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
uses: actions/checkout@v3
- name: Set up Rust toolchain
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
uses: dtolnay/rust-toolchain@ba37adf8f94a7d9affce79bd3baff1b9e3189c33 # https://github.com/dtolnay/rust-toolchain/commit/ba37adf8f94a7d9affce79bd3baff1b9e3189c33
with:
toolchain: stable
@ -82,15 +81,12 @@ jobs:
target: ${{ matrix.info.target }}
- name: Enable Rust cache
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
uses: Swatinem/rust-cache@22c9328bcba27aa81a32b1bef27c7e3c78052531 # 2.0.1
- name: Check cargo fmt
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
run: cargo fmt --all -- --check
- name: Build tests
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
uses: ClementTsang/cargo-action@v0.0.3
with:
command: test
@ -101,7 +97,6 @@ jobs:
RUST_BACKTRACE: full
- name: Run tests
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
uses: ClementTsang/cargo-action@v0.0.3
with:
command: test
@ -112,7 +107,6 @@ jobs:
RUST_BACKTRACE: full
- name: Run clippy
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
uses: ClementTsang/cargo-action@v0.0.3
with:
command: clippy
@ -126,6 +120,7 @@ jobs:
other_check:
needs: pre_job
runs-on: ${{ matrix.info.os }}
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
continue-on-error: true
strategy:
fail-fast: false
@ -217,27 +212,32 @@ jobs:
steps:
- name: Checkout repository
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
uses: actions/checkout@v3
- name: Set up Rust toolchain
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
uses: dtolnay/rust-toolchain@ba37adf8f94a7d9affce79bd3baff1b9e3189c33 # https://github.com/dtolnay/rust-toolchain/commit/ba37adf8f94a7d9affce79bd3baff1b9e3189c33
with:
toolchain: ${{ matrix.info.rust }}
target: ${{ matrix.info.target }}
- name: Enable Rust cache
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
uses: Swatinem/rust-cache@22c9328bcba27aa81a32b1bef27c7e3c78052531 # 2.0.1
with:
key: ${{ matrix.info.target }}
- name: Check
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
uses: ClementTsang/cargo-action@v0.0.3
with:
command: check
args: --all-targets --verbose --target=${{ matrix.info.target }} --locked
use-cross: ${{ matrix.info.cross }}
cross-version: 0.2.4
completion:
name: "CI Pass Check"
needs: [supported, other_check]
runs-on: "ubuntu-latest"
steps:
- name: CI Passed
run: |
echo "CI workflow completed."