-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ci: add CHANGELOG check and specific targets #456
Changes from all commits
2bc814f
031b6c7
4a29ba1
3f2ec3e
0491134
416ca72
856c323
81ce93c
49136a3
fb69828
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Runs changelog related jobs. | ||
# CI job heavily inspired by: https://github.com/tarides/changelog-check-action | ||
|
||
name: changelog | ||
|
||
on: | ||
pull_request: | ||
types: [opened, reopened, synchronize, labeled, unlabeled] | ||
|
||
jobs: | ||
changelog: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@main | ||
with: | ||
fetch-depth: 0 | ||
- name: Check for changes in changelog | ||
env: | ||
BASE_REF: ${{ github.event.pull_request.base.ref }} | ||
NO_CHANGELOG_LABEL: ${{ contains(github.event.pull_request.labels.*.name, 'no changelog') }} | ||
run: ./scripts/check-changelog.sh "${{ inputs.changelog }}" | ||
shell: bash |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,7 +10,7 @@ FEATURES_CLIENT="testing, concurrent" | |
FEATURES_CLI="testing, concurrent" | ||
NODE_FEATURES_TESTING="testing" | ||
WARNINGS=RUSTDOCFLAGS="-D warnings" | ||
NODE_BRANCH="main" | ||
NODE_BRANCH="next" | ||
|
||
# --- Linting ------------------------------------------------------------------------------------- | ||
|
||
|
@@ -107,3 +107,13 @@ build: ## Builds the CLI binary and client library in release mode | |
|
||
build-wasm: ## Builds the client library for wasm32 | ||
cargo build --target wasm32-unknown-unknown --features idxdb,web-tonic --no-default-features --package miden-client | ||
|
||
# --- Check --------------------------------------------------------------------------------------- | ||
|
||
.PHONY: check | ||
check: ## Builds the CLI binary and client library in release mode | ||
cargo check --release --features $(FEATURES_CLI) | ||
|
||
.PHONY: check-wasm | ||
check-wasm: ## Builds the client library for wasm32 | ||
cargo check --target wasm32-unknown-unknown --features idxdb,web-tonic --no-default-features --package miden-client | ||
Comment on lines
+113
to
+119
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I know this has already been merged, but I would do a small follow-up PR to update the descriptions of these commands (otherwise, they are identical to the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh, my bad. I created this PR to fix this. Will create an issue to link it too. Sorry. |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
[toolchain] | ||
channel = "1.78" | ||
components = ["rustfmt", "rust-src", "clippy"] | ||
targets = ["wasm32-unknown-unknown"] | ||
profile = "minimal" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/bin/bash | ||
set -uo pipefail | ||
|
||
CHANGELOG_FILE="${1:-CHANGELOG.md}" | ||
|
||
if [ "${NO_CHANGELOG_LABEL}" = "true" ]; then | ||
# 'no changelog' set, so finish successfully | ||
echo "\"no changelog\" label has been set" | ||
exit 0 | ||
else | ||
# a changelog check is required | ||
# fail if the diff is empty | ||
if git diff --exit-code "origin/${BASE_REF}" -- "${CHANGELOG_FILE}"; then | ||
>&2 echo "Changes should come with an entry in the \"CHANGELOG.md\" file. This behavior | ||
can be overridden by using the \"no changelog\" label, which is used for changes | ||
that are trivial / explicitely stated not to require a changelog entry." | ||
exit 1 | ||
fi | ||
|
||
echo "The \"CHANGELOG.md\" file has been updated." | ||
fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should add the phony targets for these