diff --git a/.github/workflows/changelog.yml b/.github/workflows/changelog.yml new file mode 100644 index 000000000..5fde0d8d0 --- /dev/null +++ b/.github/workflows/changelog.yml @@ -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] + +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 diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index b8ec225e2..215848440 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -9,17 +9,6 @@ on: types: [opened, reopened, synchronize] jobs: - version: - name: check rust version consistency - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@main - with: - profile: minimal - override: true - - name: check rust versions - run: ./scripts/check-rust-version.sh - rustfmt: name: rustfmt check nightly on ubuntu-latest runs-on: ubuntu-latest @@ -40,4 +29,25 @@ jobs: run: | rustup update --no-self-update nightly rustup +nightly component add clippy - make clippy \ No newline at end of file + make clippy + + doc: + name: doc stable on ubuntu-latest + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@main + - name: Build docs + run: | + rustup update --no-self-update + make doc + + version: + name: check rust version consistency + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@main + with: + profile: minimal + override: true + - name: check rust versions + run: ./scripts/check-rust-version.sh diff --git a/CHANGELOG.md b/CHANGELOG.md index 6c10b0224..2e8b4820d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,53 +4,53 @@ ### Enhancements -* [BREAKING] Configuration files with unknown properties are now rejected (#401). -* [BREAKING] Removed redundant node configuration properties (#401). -* Improve type safety of the transaction inputs nullifier mapping (#406). -* Embed the faucet's static website resources (#411). +- [BREAKING] Configuration files with unknown properties are now rejected (#401). +- [BREAKING] Removed redundant node configuration properties (#401). +- Improve type safety of the transaction inputs nullifier mapping (#406). +- Embed the faucet's static website resources (#411). +- Added warning on CI for `CHANGELOG.md` (#413). ## 0.4.0 (2024-07-04) ### Features -* Changed sync endpoint to return a list of committed transactions (#377). -* Added `aux` column to notes table (#384). -* Changed state sync endpoint to return a list of `TransactionSummary` objects instead of just transaction IDs (#386). -* Added support for unauthenticated transaction notes (#390). +- Changed sync endpoint to return a list of committed transactions (#377). +- Added `aux` column to notes table (#384). +- Changed state sync endpoint to return a list of `TransactionSummary` objects instead of just transaction IDs (#386). +- Added support for unauthenticated transaction notes (#390). ### Enhancements -* Standardized CI and Makefile across Miden repositories (#367) -* Removed client dependency from faucet (#368). -* Fixed faucet note script so that it uses the `aux` input (#387). -* Added crate to distribute node RPC protobuf files (#391). -* Add `init` command for node and faucet (#392). - +- Standardized CI and Makefile across Miden repositories (#367) +- Removed client dependency from faucet (#368). +- Fixed faucet note script so that it uses the `aux` input (#387). +- Added crate to distribute node RPC protobuf files (#391). +- Add `init` command for node and faucet (#392). ## 0.3.0 (2024-05-15) -* Added option to mint pulic notes in the faucet (#339). -* Renamed `note_hash` into `note_id` in the database (#336) -* Changed `version` and `timestamp` fields in `Block` message to `u32` (#337). -* [BREAKING] Implemented `NoteMetadata` protobuf message (#338). -* Added `GetBlockByNumber` endpoint (#340). -* Added block authentication data to the `GetBlockHeaderByNumber` RPC (#345). -* Enabled support for HTTP/1.1 requests for the RPC component (#352). +- Added option to mint pulic notes in the faucet (#339). +- Renamed `note_hash` into `note_id` in the database (#336) +- Changed `version` and `timestamp` fields in `Block` message to `u32` (#337). +- [BREAKING] Implemented `NoteMetadata` protobuf message (#338). +- Added `GetBlockByNumber` endpoint (#340). +- Added block authentication data to the `GetBlockHeaderByNumber` RPC (#345). +- Enabled support for HTTP/1.1 requests for the RPC component (#352). ## 0.2.1 (2024-04-27) -* Combined node components into a single binary (#323). +- Combined node components into a single binary (#323). ## 0.2.0 (2024-04-11) -* Implemented Docker-based node deployment (#257). -* Improved build process (#267, #272, #278). -* Implemented Nullifier tree wrapper (#275). -* [BREAKING] Added support for public accounts (#287, #293, #294). -* [BREAKING] Added support for public notes (#300, #310). -* Added `GetNotesById` endpoint (#298). -* Implemented amd64 debian packager (#312). +- Implemented Docker-based node deployment (#257). +- Improved build process (#267, #272, #278). +- Implemented Nullifier tree wrapper (#275). +- [BREAKING] Added support for public accounts (#287, #293, #294). +- [BREAKING] Added support for public notes (#300, #310). +- Added `GetNotesById` endpoint (#298). +- Implemented amd64 debian packager (#312). ## 0.1.0 (2024-03-11) -* Initial release. +- Initial release. diff --git a/rust-toolchain b/rust-toolchain deleted file mode 100644 index 8e95c75da..000000000 --- a/rust-toolchain +++ /dev/null @@ -1 +0,0 @@ -1.78 diff --git a/rust-toolchain.toml b/rust-toolchain.toml new file mode 100644 index 000000000..4305111e7 --- /dev/null +++ b/rust-toolchain.toml @@ -0,0 +1,4 @@ +[toolchain] +channel = "1.78" +components = ["rustfmt", "rust-src", "clippy"] +profile = "minimal" diff --git a/scripts/check-changelog.sh b/scripts/check-changelog.sh new file mode 100755 index 000000000..dbf14cdbb --- /dev/null +++ b/scripts/check-changelog.sh @@ -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 diff --git a/scripts/check-rust-version.sh b/scripts/check-rust-version.sh index a98dd8bf3..1e795bc0e 100755 --- a/scripts/check-rust-version.sh +++ b/scripts/check-rust-version.sh @@ -1,12 +1,14 @@ #!/bin/bash -# Check rust-toolchain file -TOOLCHAIN_VERSION=$(cat rust-toolchain) +# Get rust-toolchain.toml file channel +TOOLCHAIN_VERSION=$(grep 'channel' rust-toolchain.toml | sed -E 's/.*"(.*)".*/\1/') -# Check workspace Cargo.toml file -CARGO_VERSION=$(cat Cargo.toml | grep "rust-version" | cut -d '"' -f 2) +# Get workspace Cargo.toml file rust-version +CARGO_VERSION=$(grep 'rust-version' Cargo.toml | sed -E 's/.*"(.*)".*/\1/') + +# Check version match if [ "$CARGO_VERSION" != "$TOOLCHAIN_VERSION" ]; then - echo "Mismatch in $file. Expected $TOOLCHAIN_VERSION, found $CARGO_VERSION" + echo "Mismatch in Cargo.toml: Expected $TOOLCHAIN_VERSION, found $CARGO_VERSION" exit 1 fi