2021-02-24 09:48:41 +00:00
|
|
|
name: Lint
|
|
|
|
|
2023-11-06 23:53:36 +00:00
|
|
|
on:
|
|
|
|
pull_request: {}
|
|
|
|
merge_group: { types: [checks_requested] }
|
2023-04-01 21:39:19 +01:00
|
|
|
|
|
|
|
permissions:
|
|
|
|
contents: read
|
|
|
|
|
|
|
|
concurrency:
|
|
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
|
|
cancel-in-progress: true
|
2020-07-22 12:32:13 +09:00
|
|
|
|
|
|
|
jobs:
|
2021-02-24 09:48:41 +00:00
|
|
|
fmt:
|
2020-07-22 12:32:13 +09:00
|
|
|
runs-on: ubuntu-latest
|
2023-04-01 21:39:19 +01:00
|
|
|
|
2020-07-22 12:32:13 +09:00
|
|
|
steps:
|
2023-10-29 04:17:06 +00:00
|
|
|
- uses: actions/checkout@v4
|
2020-07-22 12:32:13 +09:00
|
|
|
|
2024-10-07 19:48:02 +01:00
|
|
|
- uses: actions-rust-lang/setup-rust-toolchain@v1.10.1
|
2023-04-01 21:39:19 +01:00
|
|
|
with:
|
|
|
|
toolchain: nightly
|
|
|
|
components: rustfmt
|
|
|
|
|
2021-02-24 09:48:41 +00:00
|
|
|
- name: Rustfmt Check
|
2023-01-28 05:36:05 +09:00
|
|
|
run: cargo fmt --all -- --check
|
2020-07-22 12:32:13 +09:00
|
|
|
|
2021-02-24 09:48:41 +00:00
|
|
|
clippy:
|
2023-04-01 21:39:19 +01:00
|
|
|
permissions:
|
|
|
|
contents: write
|
|
|
|
|
2021-02-24 09:48:41 +00:00
|
|
|
runs-on: ubuntu-latest
|
2023-04-01 21:39:19 +01:00
|
|
|
|
2021-02-24 09:48:41 +00:00
|
|
|
steps:
|
2023-10-29 04:17:06 +00:00
|
|
|
- uses: actions/checkout@v4
|
2021-02-24 09:48:41 +00:00
|
|
|
|
2024-10-07 19:48:02 +01:00
|
|
|
- uses: actions-rust-lang/setup-rust-toolchain@v1.10.1
|
2023-04-01 21:39:19 +01:00
|
|
|
with: { components: clippy }
|
|
|
|
|
2023-10-29 01:55:34 +00:00
|
|
|
- uses: giraffate/clippy-action@v1.0.1
|
2020-07-22 12:32:13 +09:00
|
|
|
with:
|
2024-11-24 00:55:18 +00:00
|
|
|
reporter: "github-pr-check"
|
2023-01-28 05:36:05 +09:00
|
|
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
2023-10-29 01:55:34 +00:00
|
|
|
clippy_flags: --workspace --all-features --tests --examples --bins -- -Dclippy::todo -Aunknown_lints
|
2023-10-30 00:07:28 +00:00
|
|
|
|
|
|
|
check-external-types:
|
2024-11-14 09:43:47 +01:00
|
|
|
if: false # rustdoc mismatch currently
|
2023-10-30 00:07:28 +00:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v4
|
|
|
|
|
2024-11-14 09:43:47 +01:00
|
|
|
- name: Install Rust (${{ vars.RUST_VERSION_EXTERNAL_TYPES }})
|
2024-10-07 19:48:02 +01:00
|
|
|
uses: actions-rust-lang/setup-rust-toolchain@v1.10.1
|
2023-10-30 00:07:28 +00:00
|
|
|
with:
|
2024-11-14 09:43:47 +01:00
|
|
|
toolchain: ${{ vars.RUST_VERSION_EXTERNAL_TYPES }}
|
2023-10-30 00:07:28 +00:00
|
|
|
|
|
|
|
- name: Install just
|
2024-12-10 11:48:02 +00:00
|
|
|
uses: taiki-e/install-action@v2.46.4
|
2023-10-30 00:07:28 +00:00
|
|
|
with:
|
|
|
|
tool: just
|
|
|
|
|
|
|
|
- name: Install cargo-check-external-types
|
2024-06-10 20:36:41 +01:00
|
|
|
uses: taiki-e/cache-cargo-install-action@v2.0.1
|
2023-10-30 00:07:28 +00:00
|
|
|
with:
|
2024-11-14 09:43:47 +01:00
|
|
|
tool: cargo-check-external-types
|
2023-10-30 00:07:28 +00:00
|
|
|
|
|
|
|
- name: check external types
|
2024-11-14 09:43:47 +01:00
|
|
|
run: just check-external-types-all +${{ vars.RUST_VERSION_EXTERNAL_TYPES }}
|
2024-11-24 00:55:18 +00:00
|
|
|
|
|
|
|
public-api-diff:
|
|
|
|
name: Public API Diff
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Checkout main branch
|
|
|
|
uses: actions/checkout@v4
|
|
|
|
with:
|
|
|
|
ref: ${{ github.base_ref }}
|
|
|
|
|
|
|
|
- name: Checkout PR branch
|
|
|
|
uses: actions/checkout@v4
|
|
|
|
|
|
|
|
- name: Install Rust (${{ vars.RUST_VERSION_API_DIFF }})
|
2024-12-02 08:31:34 +00:00
|
|
|
uses: actions-rust-lang/setup-rust-toolchain@v1.10.1
|
2024-11-24 00:55:18 +00:00
|
|
|
with:
|
|
|
|
toolchain: ${{ vars.RUST_VERSION_API_DIFF }}
|
|
|
|
|
|
|
|
- name: Install cargo-public-api
|
2024-12-10 11:48:02 +00:00
|
|
|
uses: taiki-e/install-action@v2.46.4
|
2024-11-24 00:55:18 +00:00
|
|
|
with:
|
|
|
|
tool: cargo-public-api
|
|
|
|
|
|
|
|
- name: Generate API diff
|
|
|
|
run: |
|
|
|
|
for f in $(find -mindepth 2 -maxdepth 2 -name Cargo.toml); do
|
|
|
|
cargo public-api --manifest-path "$f" --simplified diff ${{ github.event.pull_request.base.sha }}..${{ github.sha }}
|
|
|
|
done
|