mirror of
https://github.com/gfx-rs/wgpu.git
synced 2025-12-08 21:26:17 +00:00
An even fancier CHANGELOG check in CI (#8416)
This commit is contained in:
parent
3a157f7497
commit
ee08b916e5
9
.github/workflows/changelog.yml
vendored
9
.github/workflows/changelog.yml
vendored
@ -6,6 +6,12 @@ on:
|
||||
- ".github/workflows/changelog.yml"
|
||||
- "CHANGELOG.md"
|
||||
- "xtask/**/*"
|
||||
types:
|
||||
- opened
|
||||
- synchronize
|
||||
- reopened
|
||||
- labeled
|
||||
- unlabeled
|
||||
|
||||
env:
|
||||
#
|
||||
@ -38,6 +44,7 @@ jobs:
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
# NOTE: Keep label name(s) in sync. with `xtask`'s implementation.
|
||||
- name: Run `cargo xtask changelog …`
|
||||
run: |
|
||||
cargo xtask changelog "origin/${{ github.event.pull_request.base.ref }}"
|
||||
cargo xtask changelog "origin/${{ github.event.pull_request.base.ref }}" ${{ contains(github.event.pull_request.labels.*.name, 'changelog: released entry changed') && '--allow-released-changes' || '' }}
|
||||
|
||||
@ -6,6 +6,7 @@ use xshell::Shell;
|
||||
|
||||
pub(crate) fn check_changelog(shell: Shell, mut args: Arguments) -> anyhow::Result<()> {
|
||||
const CHANGELOG_PATH_RELATIVE: &str = "./CHANGELOG.md";
|
||||
let allow_released_changes = args.contains("--allow-released-changes");
|
||||
|
||||
let from_branch = args
|
||||
.free_from_str()
|
||||
@ -72,7 +73,12 @@ pub(crate) fn check_changelog(shell: Shell, mut args: Arguments) -> anyhow::Resu
|
||||
"one or more checks against `{}` failed; see above for details",
|
||||
CHANGELOG_PATH_RELATIVE,
|
||||
);
|
||||
Err(anyhow::Error::msg(msg))
|
||||
if allow_released_changes {
|
||||
log::warn!("{msg}");
|
||||
Ok(())
|
||||
} else {
|
||||
Err(anyhow::Error::msg(msg))
|
||||
}
|
||||
} else {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
@ -53,6 +53,8 @@ Commands:
|
||||
|
||||
`<to_commit>` is the tip of the `git diff` that will be used for checking (1).
|
||||
|
||||
--allow-released-changes Only reports issues as warnings, rather than reporting errors and forcing a non-zero exit code.
|
||||
|
||||
miri
|
||||
Run all miri-compatible tests under miri. Requires a nightly toolchain
|
||||
with the x86_64-unknown-linux-gnu target and miri component installed.
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user