mirror of
https://github.com/ClementTsang/bottom
synced 2024-11-22 20:23:12 +00:00
ci: deal with skipping, matrices, reliant jobs (#617)
This time, the problem is that since the matrix jobs rely on another job, they never trigger and clog up CI.
This commit is contained in:
parent
5c8757a1fa
commit
16f0913307
1 changed files with 26 additions and 18 deletions
44
.github/workflows/ci.yml
vendored
44
.github/workflows/ci.yml
vendored
|
@ -14,10 +14,15 @@ on:
|
|||
- master
|
||||
|
||||
jobs:
|
||||
pre_job:
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
should_skip: ${{ steps.skip_check.outputs.should_skip }}
|
||||
rustfmt:
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os:
|
||||
- ubuntu-latest
|
||||
- macOS-latest
|
||||
- windows-2019
|
||||
steps:
|
||||
- id: skip_check
|
||||
uses: fkirc/skip-duplicate-actions@master
|
||||
|
@ -27,20 +32,11 @@ jobs:
|
|||
paths_ignore: '["**/README.md", "**/docs/**", "assets/**", ".cargo-husky/**", ".all-contributorsrc", ".gitignore", ".markdownlint.json", "deployment/**", ".github/ISSUE_TEMPLATE/**", "CHANGELOG.md", "CONTRIBUTING.md"]'
|
||||
do_not_skip: '["workflow_dispatch"]'
|
||||
|
||||
rustfmt:
|
||||
needs: pre_job
|
||||
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os:
|
||||
- ubuntu-latest
|
||||
- macOS-latest
|
||||
- windows-2019
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
if: ${{ steps.skip_check.outputs.should_skip != 'true' }}
|
||||
|
||||
- uses: actions-rs/toolchain@v1
|
||||
if: ${{ steps.skip_check.outputs.should_skip != 'true' }}
|
||||
with:
|
||||
profile: minimal
|
||||
toolchain: stable
|
||||
|
@ -48,12 +44,12 @@ jobs:
|
|||
components: rustfmt
|
||||
|
||||
- uses: Swatinem/rust-cache@v1
|
||||
if: ${{ steps.skip_check.outputs.should_skip != 'true' }}
|
||||
|
||||
- run: cargo fmt --all -- --check
|
||||
if: ${{ steps.skip_check.outputs.should_skip != 'true' }}
|
||||
|
||||
clippy:
|
||||
needs: pre_job
|
||||
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
|
@ -63,9 +59,19 @@ jobs:
|
|||
- macOS-latest
|
||||
- windows-2019
|
||||
steps:
|
||||
- id: skip_check
|
||||
uses: fkirc/skip-duplicate-actions@master
|
||||
with:
|
||||
concurrent_skipping: "same_content_newer"
|
||||
skip_after_successful_duplicate: "true"
|
||||
paths_ignore: '["**/README.md", "**/docs/**", "assets/**", ".cargo-husky/**", ".all-contributorsrc", ".gitignore", ".markdownlint.json", "deployment/**", ".github/ISSUE_TEMPLATE/**", "CHANGELOG.md", "CONTRIBUTING.md"]'
|
||||
do_not_skip: '["workflow_dispatch"]'
|
||||
|
||||
- uses: actions/checkout@v2
|
||||
if: ${{ steps.skip_check.outputs.should_skip != 'true' }}
|
||||
|
||||
- uses: actions-rs/toolchain@v1
|
||||
if: ${{ steps.skip_check.outputs.should_skip != 'true' }}
|
||||
with:
|
||||
profile: minimal
|
||||
toolchain: stable
|
||||
|
@ -73,8 +79,10 @@ jobs:
|
|||
components: clippy
|
||||
|
||||
- uses: Swatinem/rust-cache@v1
|
||||
if: ${{ steps.skip_check.outputs.should_skip != 'true' }}
|
||||
|
||||
- run: cargo clippy --all-targets --workspace -- -D warnings
|
||||
if: ${{ steps.skip_check.outputs.should_skip != 'true' }}
|
||||
|
||||
# Run cargo --check on all platforms
|
||||
check:
|
||||
|
|
Loading…
Reference in a new issue