mirror of
https://github.com/ClementTsang/bottom.git
synced 2025-07-21 20:54:43 +02: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
44
.github/workflows/ci.yml
vendored
44
.github/workflows/ci.yml
vendored
@ -14,10 +14,15 @@ on:
|
|||||||
- master
|
- master
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
pre_job:
|
rustfmt:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ${{ matrix.os }}
|
||||||
outputs:
|
strategy:
|
||||||
should_skip: ${{ steps.skip_check.outputs.should_skip }}
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
os:
|
||||||
|
- ubuntu-latest
|
||||||
|
- macOS-latest
|
||||||
|
- windows-2019
|
||||||
steps:
|
steps:
|
||||||
- id: skip_check
|
- id: skip_check
|
||||||
uses: fkirc/skip-duplicate-actions@master
|
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"]'
|
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"]'
|
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
|
- uses: actions/checkout@v2
|
||||||
|
if: ${{ steps.skip_check.outputs.should_skip != 'true' }}
|
||||||
|
|
||||||
- uses: actions-rs/toolchain@v1
|
- uses: actions-rs/toolchain@v1
|
||||||
|
if: ${{ steps.skip_check.outputs.should_skip != 'true' }}
|
||||||
with:
|
with:
|
||||||
profile: minimal
|
profile: minimal
|
||||||
toolchain: stable
|
toolchain: stable
|
||||||
@ -48,12 +44,12 @@ jobs:
|
|||||||
components: rustfmt
|
components: rustfmt
|
||||||
|
|
||||||
- uses: Swatinem/rust-cache@v1
|
- uses: Swatinem/rust-cache@v1
|
||||||
|
if: ${{ steps.skip_check.outputs.should_skip != 'true' }}
|
||||||
|
|
||||||
- run: cargo fmt --all -- --check
|
- run: cargo fmt --all -- --check
|
||||||
|
if: ${{ steps.skip_check.outputs.should_skip != 'true' }}
|
||||||
|
|
||||||
clippy:
|
clippy:
|
||||||
needs: pre_job
|
|
||||||
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
|
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
@ -63,9 +59,19 @@ jobs:
|
|||||||
- macOS-latest
|
- macOS-latest
|
||||||
- windows-2019
|
- windows-2019
|
||||||
steps:
|
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
|
- uses: actions/checkout@v2
|
||||||
|
if: ${{ steps.skip_check.outputs.should_skip != 'true' }}
|
||||||
|
|
||||||
- uses: actions-rs/toolchain@v1
|
- uses: actions-rs/toolchain@v1
|
||||||
|
if: ${{ steps.skip_check.outputs.should_skip != 'true' }}
|
||||||
with:
|
with:
|
||||||
profile: minimal
|
profile: minimal
|
||||||
toolchain: stable
|
toolchain: stable
|
||||||
@ -73,8 +79,10 @@ jobs:
|
|||||||
components: clippy
|
components: clippy
|
||||||
|
|
||||||
- uses: Swatinem/rust-cache@v1
|
- uses: Swatinem/rust-cache@v1
|
||||||
|
if: ${{ steps.skip_check.outputs.should_skip != 'true' }}
|
||||||
|
|
||||||
- run: cargo clippy --all-targets --workspace -- -D warnings
|
- run: cargo clippy --all-targets --workspace -- -D warnings
|
||||||
|
if: ${{ steps.skip_check.outputs.should_skip != 'true' }}
|
||||||
|
|
||||||
# Run cargo --check on all platforms
|
# Run cargo --check on all platforms
|
||||||
check:
|
check:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user