2020-01-21 06:46:53 -06:00
|
|
|
name: Clippy Dev Test
|
|
|
|
|
|
|
|
on:
|
2024-10-25 03:28:45 -05:00
|
|
|
merge_group:
|
2020-01-21 06:46:53 -06:00
|
|
|
pull_request:
|
|
|
|
|
|
|
|
env:
|
|
|
|
RUST_BACKTRACE: 1
|
2022-10-13 07:33:04 -05:00
|
|
|
CARGO_INCREMENTAL: 0
|
2024-08-06 09:12:49 -05:00
|
|
|
RUSTFLAGS: -D warnings
|
2020-01-21 06:46:53 -06:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
clippy_dev:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
2020-02-07 15:24:41 -06:00
|
|
|
# Setup
|
2020-12-10 01:53:27 -06:00
|
|
|
- name: Checkout
|
2023-12-26 17:43:16 -06:00
|
|
|
uses: actions/checkout@v4
|
2020-12-10 01:53:27 -06:00
|
|
|
|
2020-02-07 15:24:41 -06:00
|
|
|
# Run
|
2020-01-21 06:46:53 -06:00
|
|
|
- name: Build
|
2024-08-06 09:12:49 -05:00
|
|
|
run: cargo build
|
2020-01-21 06:46:53 -06:00
|
|
|
working-directory: clippy_dev
|
2020-02-07 15:24:41 -06:00
|
|
|
|
2020-01-21 06:46:53 -06:00
|
|
|
- name: Test update_lints
|
|
|
|
run: cargo dev update_lints --check
|
2020-02-07 15:24:41 -06:00
|
|
|
|
2020-01-21 06:46:53 -06:00
|
|
|
- name: Test fmt
|
|
|
|
run: cargo dev fmt --check
|
2020-02-04 10:33:50 -06:00
|
|
|
|
2022-03-01 04:10:01 -06:00
|
|
|
- name: Test cargo dev new lint
|
2024-08-06 09:12:49 -05:00
|
|
|
env:
|
|
|
|
RUSTFLAGS: -A unused-imports
|
2022-03-01 04:10:01 -06:00
|
|
|
run: |
|
|
|
|
cargo dev new_lint --name new_early_pass --pass early
|
|
|
|
cargo dev new_lint --name new_late_pass --pass late
|
|
|
|
cargo check
|
|
|
|
git reset --hard HEAD
|
|
|
|
|
2024-10-25 03:28:45 -05:00
|
|
|
conclusion_dev:
|
|
|
|
needs: [ clippy_dev ]
|
|
|
|
# We need to ensure this job does *not* get skipped if its dependencies fail,
|
|
|
|
# because a skipped job is considered a success by GitHub. So we have to
|
|
|
|
# overwrite `if:`. We use `!cancelled()` to ensure the job does still not get run
|
|
|
|
# when the workflow is canceled manually.
|
|
|
|
#
|
|
|
|
# ALL THE PREVIOUS JOBS NEED TO BE ADDED TO THE `needs` SECTION OF THIS JOB!
|
|
|
|
if: ${{ !cancelled() }}
|
2020-02-04 10:33:50 -06:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2024-10-25 03:28:45 -05:00
|
|
|
# Manually check the status of all dependencies. `if: failure()` does not work.
|
|
|
|
- name: Conclusion
|
|
|
|
run: |
|
|
|
|
# Print the dependent jobs to see them in the CI log
|
|
|
|
jq -C <<< '${{ toJson(needs) }}'
|
|
|
|
# Check if all jobs that we depend on (in the needs array) were successful.
|
|
|
|
jq --exit-status 'all(.result == "success")' <<< '${{ toJson(needs) }}'
|