mirror of
https://github.com/ClementTsang/bottom.git
synced 2025-07-20 12:14:50 +02:00
ci: use one skip check for CI workflow (#855)
Use one single skip check job for CI like other workflows.
This commit is contained in:
parent
51498e1238
commit
fec56372bb
@ -2,6 +2,9 @@
|
|||||||
---
|
---
|
||||||
# Configuration for CirrusCI. This is primarily used for
|
# Configuration for CirrusCI. This is primarily used for
|
||||||
# FreeBSD and macOS M1 tests and builds.
|
# FreeBSD and macOS M1 tests and builds.
|
||||||
|
#
|
||||||
|
# We set the YAML directive above to prevent some linting errors around the
|
||||||
|
# templates.
|
||||||
|
|
||||||
setup_template: &SETUP_TEMPLATE
|
setup_template: &SETUP_TEMPLATE
|
||||||
setup_script:
|
setup_script:
|
||||||
|
54
.github/workflows/ci.yml
vendored
54
.github/workflows/ci.yml
vendored
@ -29,8 +29,23 @@ concurrency:
|
|||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
# Check if things should be skipped.
|
||||||
|
pre_job:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
outputs:
|
||||||
|
should_skip: ${{ steps.skip_check.outputs.should_skip }}
|
||||||
|
steps:
|
||||||
|
- name: Check if this action should be skipped
|
||||||
|
id: skip_check
|
||||||
|
uses: fkirc/skip-duplicate-actions@f11521568414503656a5af807dc3018c012552c4 # v5.2.0
|
||||||
|
with:
|
||||||
|
skip_after_successful_duplicate: "true"
|
||||||
|
paths: '[".cargo/**", ".github/workflows/ci.yml", "sample_configs/**", "src/**", "tests/**", "build.rs", "Cargo.lock", "Cargo.toml", "clippy.toml", "rustfmt.toml"]'
|
||||||
|
do_not_skip: '["workflow_dispatch", "push"]'
|
||||||
|
|
||||||
# Runs rustfmt + tests + clippy on the main supported platforms.
|
# Runs rustfmt + tests + clippy on the main supported platforms.
|
||||||
supported:
|
supported:
|
||||||
|
needs: pre_job
|
||||||
runs-on: ${{ matrix.info.os }}
|
runs-on: ${{ matrix.info.os }}
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
@ -54,20 +69,12 @@ jobs:
|
|||||||
}
|
}
|
||||||
features: ["--all-features", "--no-default-features"]
|
features: ["--all-features", "--no-default-features"]
|
||||||
steps:
|
steps:
|
||||||
- name: Check if this action should be skipped
|
|
||||||
id: skip_check
|
|
||||||
uses: fkirc/skip-duplicate-actions@f11521568414503656a5af807dc3018c012552c4 # v5.2.0
|
|
||||||
with:
|
|
||||||
skip_after_successful_duplicate: "true"
|
|
||||||
paths: '[".cargo/**", ".github/workflows/ci.yml", "sample_configs/**", "src/**", "tests/**", "build.rs", "Cargo.lock", "Cargo.toml", "clippy.toml", "rustfmt.toml"]'
|
|
||||||
do_not_skip: '["workflow_dispatch", "push"]'
|
|
||||||
|
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
|
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
if: ${{ steps.skip_check.outputs.should_skip != 'true' }}
|
|
||||||
|
|
||||||
- name: Set up Rust toolchain
|
- name: Set up Rust toolchain
|
||||||
if: ${{ steps.skip_check.outputs.should_skip != 'true' }}
|
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
|
||||||
@ -75,15 +82,15 @@ jobs:
|
|||||||
target: ${{ matrix.info.target }}
|
target: ${{ matrix.info.target }}
|
||||||
|
|
||||||
- name: Enable Rust cache
|
- name: Enable Rust cache
|
||||||
if: ${{ steps.skip_check.outputs.should_skip != 'true' }}
|
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: ${{ steps.skip_check.outputs.should_skip != 'true' }}
|
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: ${{ steps.skip_check.outputs.should_skip != 'true' }}
|
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
|
||||||
@ -94,7 +101,7 @@ jobs:
|
|||||||
RUST_BACKTRACE: full
|
RUST_BACKTRACE: full
|
||||||
|
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
if: ${{ steps.skip_check.outputs.should_skip != 'true' }}
|
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
|
||||||
@ -105,7 +112,7 @@ jobs:
|
|||||||
RUST_BACKTRACE: full
|
RUST_BACKTRACE: full
|
||||||
|
|
||||||
- name: Run clippy
|
- name: Run clippy
|
||||||
if: ${{ steps.skip_check.outputs.should_skip != 'true' }}
|
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
|
||||||
@ -117,6 +124,7 @@ jobs:
|
|||||||
|
|
||||||
# Run cargo check on all other platforms
|
# Run cargo check on all other platforms
|
||||||
other_check:
|
other_check:
|
||||||
|
needs: pre_job
|
||||||
runs-on: ${{ matrix.info.os }}
|
runs-on: ${{ matrix.info.os }}
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
strategy:
|
strategy:
|
||||||
@ -208,33 +216,25 @@ jobs:
|
|||||||
}
|
}
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Check if this action should be skipped
|
|
||||||
id: skip_check
|
|
||||||
uses: fkirc/skip-duplicate-actions@f11521568414503656a5af807dc3018c012552c4 # v5.2.0
|
|
||||||
with:
|
|
||||||
skip_after_successful_duplicate: "true"
|
|
||||||
paths: '[".cargo/**", ".github/workflows/ci.yml", "sample_configs/**", "src/**", "tests/**", "build.rs", "Cargo.lock", "Cargo.toml", "clippy.toml", "rustfmt.toml"]'
|
|
||||||
do_not_skip: '["workflow_dispatch", "push"]'
|
|
||||||
|
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
|
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
if: ${{ steps.skip_check.outputs.should_skip != 'true' }}
|
|
||||||
|
|
||||||
- name: Set up Rust toolchain
|
- name: Set up Rust toolchain
|
||||||
if: ${{ steps.skip_check.outputs.should_skip != 'true' }}
|
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
|
||||||
if: ${{ steps.skip_check.outputs.should_skip != 'true' }}
|
|
||||||
with:
|
with:
|
||||||
key: ${{ matrix.info.target }}
|
key: ${{ matrix.info.target }}
|
||||||
|
|
||||||
- name: Check
|
- name: Check
|
||||||
if: ${{ steps.skip_check.outputs.should_skip != 'true' }}
|
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
|
||||||
|
2
.github/workflows/coverage.yml
vendored
2
.github/workflows/coverage.yml
vendored
@ -1,4 +1,4 @@
|
|||||||
# Code coverage generation via cargo-llvm-cov, and uploaded to codecov.
|
# Code coverage generation via cargo-llvm-cov, which is then uploaded to codecov.
|
||||||
|
|
||||||
name: codecov
|
name: codecov
|
||||||
|
|
||||||
|
2
.github/workflows/test-docs.yml
vendored
2
.github/workflows/test-docs.yml
vendored
@ -19,7 +19,7 @@ jobs:
|
|||||||
uses: fkirc/skip-duplicate-actions@f11521568414503656a5af807dc3018c012552c4 # v5.2.0
|
uses: fkirc/skip-duplicate-actions@f11521568414503656a5af807dc3018c012552c4 # v5.2.0
|
||||||
with:
|
with:
|
||||||
skip_after_successful_duplicate: "true"
|
skip_after_successful_duplicate: "true"
|
||||||
paths: '["docs/**", ".github/workflows/docs.yml"]'
|
paths: '["docs/**", ".github/workflows/docs.yml", ".github/workflows/test-docs.yml"]'
|
||||||
do_not_skip: '["workflow_dispatch"]'
|
do_not_skip: '["workflow_dispatch"]'
|
||||||
|
|
||||||
test-build-documentation:
|
test-build-documentation:
|
||||||
|
@ -1,7 +1,9 @@
|
|||||||
#!/bin/python3
|
#!/bin/python3
|
||||||
|
|
||||||
# A simple script to trigger Cirrus CI builds and get the release artifacts through Cirrus CI's GraphQL interface.
|
# A simple script to trigger Cirrus CI builds and download the release artifacts
|
||||||
# Expects the API key to be set in CIRRUS_KEY.
|
# through Cirrus CI's GraphQL interface.
|
||||||
|
#
|
||||||
|
# Expects the Cirrus CI API key to be set in the CIRRUS_KEY environment variable.
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import json
|
import json
|
||||||
|
Loading…
x
Reference in New Issue
Block a user