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 ## 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 ## Issue

View File

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