-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
77 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
name: Check Changelog | ||
|
||
on: | ||
pull_request: | ||
types: [opened, reopened, labeled, unlabeled, synchronize] | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
check-changelog: | ||
runs-on: ubuntu-latest | ||
if: (!contains(github.event.pull_request.labels.*.name, 'skip changelog')) | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Check that CHANGELOG is touched | ||
run: | | ||
git fetch origin ${{ github.base_ref }} --depth 1 && \ | ||
git diff remotes/origin/${{ github.base_ref }} --name-only | grep CHANGELOG.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
# Avoid duplicate builds on PRs. | ||
branches: | ||
- main | ||
pull_request: | ||
|
||
jobs: | ||
check_publishable: | ||
runs-on: ubuntu-24.04 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Update Rust toolchain | ||
# Most of the time this will be a no-op, since GitHub releases new images every week | ||
# which include the latest stable release of Rust, Rustup, Clippy and rustfmt. | ||
run: rustup update | ||
- name: Rust Cache | ||
uses: Swatinem/[email protected] | ||
- name: Check cargo publish | ||
run: cargo publish --dry-run | ||
|
||
lint: | ||
runs-on: ubuntu-24.04 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Update Rust toolchain | ||
# Most of the time this will be a no-op, since GitHub releases new images every week | ||
# which include the latest stable release of Rust, Rustup, Clippy and rustfmt. | ||
run: rustup update | ||
- name: Rust Cache | ||
uses: Swatinem/[email protected] | ||
- name: Clippy | ||
# Using --all-targets so tests are checked and --deny to fail on warnings. | ||
# Not using --locked here and below since Cargo.lock is in .gitignore. | ||
run: cargo clippy --all-targets --all-features -- --deny warnings | ||
- name: rustfmt | ||
run: cargo fmt -- --check | ||
- name: Check docs | ||
# Using RUSTDOCFLAGS until `cargo doc --check` is stabilised: | ||
# https://github.com/rust-lang/cargo/issues/10025 | ||
run: RUSTDOCFLAGS="-D warnings" cargo doc --all-features --document-private-items --no-deps | ||
|
||
unit-test: | ||
runs-on: ubuntu-24.04 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Update Rust toolchain | ||
run: rustup update | ||
- name: Rust Cache | ||
uses: Swatinem/[email protected] | ||
- name: Run unit tests | ||
run: cargo test --all-features |