From 814b40efbe8df45ddb880b557a149e22d8b049a8 Mon Sep 17 00:00:00 2001 From: kobaltgit Date: Wed, 2 Dec 2026 11:54:13 +0200 Subject: [PATCH 1/3] chore(ci): add Windows ARM64 cross-compilation, CodeRabbit, SonarCloud & v0.4.11 --- .coderabbit.yaml | 51 ++++++++++++++ .github/workflows/ci.yml | 16 +++++ .github/workflows/release.yml | 61 ++++++++++++++++- .github/workflows/sonarcloud.yml | 73 ++++++++++++++++++++ CHANGELOG.md | 14 ++++ Cargo.toml | 2 +- README.md | 2 + README.ru.md | 2 + RELEASE_NOTES.md | 71 +++++++++---------- docs/CHECKLIST.md | 14 ++++ docs/CHRONICLE.en.md | 19 +++++ docs/CHRONICLE.md | 19 +++++ packaging/linux/control | 2 +- packaging/macos/Info.plist | 4 +- packaging/windows/installer.iss | 17 ++++- sonar-project.properties | 10 +++ website/package.json | 2 +- website/src/components/download-button.tsx | 2 +- website/src/lib/release.ts | 80 +++++++++++++++++++--- website/src/lib/use-release.ts | 15 +++- 20 files changed, 413 insertions(+), 63 deletions(-) create mode 100644 .coderabbit.yaml create mode 100644 .github/workflows/sonarcloud.yml create mode 100644 sonar-project.properties diff --git a/.coderabbit.yaml b/.coderabbit.yaml new file mode 100644 index 0000000..9675f55 --- /dev/null +++ b/.coderabbit.yaml @@ -0,0 +1,51 @@ +# yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json +language: "en-US" + +reviews: + profile: "chill" + request_changes_workflow: false + high_level_summary: true + poem: false + assessment: true + + path_filters: + - "!**/target/**" + - "!Cargo.lock" + - "!**/node_modules/**" + - "!**/.next/**" + - "!docs/IBM_SPSS_Statistics_Algorithms.pdf" + - "!specs/**" + - "!.specify/**" + + path_instructions: + - path: "crates/**" + instructions: | + - Enforce 100% Safe Rust (no `unsafe`) and zero panics in non-test code (no `unwrap()`, `expect()`, `panic!()`, `unreachable!()`, `todo!()`, `unimplemented!()`). + - Verify strict downward architectural layering: L0 (statcraft_io) -> L1 (statcraft_core) -> L2 (statcraft_algo) -> L4 (statcraft_reporting) -> L5 (statcraft_syntax) -> L6 (statcraft_app). + - Ensure all Cargo build/test commands respect the `-j 1` Resource Guard. + + - path: "crates/statcraft_app/src/**" + instructions: | + - Enforce Zero-Hardcode i18n: all user-facing strings, labels, and table headers must use Fluent `t!(...)` keys from `locales/en.ftl` and `locales/ru.ftl`. + - Enforce Vector-First UI: no emoji or unsupported Unicode symbols (`●`, `•`, `✓`, `✔`, `✕`, `✖`, etc.) that cause tofu squares in egui. + - Dialogs must use `DialogKit` (`DialogShell`, `VariablePicker`, `TransferButton`, `DialogActionBar`, `GroupBox`) rather than raw `ui.button` OK/Cancel controls. + - Respect file size limits (500 lines for dialogs/output_view, 1000 lines for editors, 1500 lines for `app.rs`). + + - path: "crates/statcraft_algo/**" + instructions: | + - Ensure clean-room numerical stability (handle NaN, empty inputs, zero variance, and singular matrices via `Result`) and verify Golden Oracle tolerances (`<= 1e-6`). + + - path: "website/src/**" + instructions: | + - Check Next.js App Router / React / TypeScript strict typing, SSR safety (`typeof window`), and English/Russian UI parity. + + tools: + clippy: + enabled: true + gitleaks: + enabled: true + markdownlint: + enabled: true + +chat: + auto_reply: true diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a724896..ce5a034 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -50,3 +50,19 @@ jobs: - name: Run CI Quality Gates run: cargo run -p xtask -j 1 -- ci + + check-windows-arm64: + name: Cross-Check (Windows ARM64) + runs-on: windows-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Setup Rust toolchain (ARM64 target) + uses: dtolnay/rust-toolchain@stable + with: + targets: aarch64-pc-windows-msvc + + - name: Check StatCraft for Windows ARM64 + shell: pwsh + run: cargo check --package statcraft_app --target aarch64-pc-windows-msvc -j 1 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 02c454c..729d961 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -7,9 +7,9 @@ on: workflow_dispatch: inputs: tag: - description: 'Release Tag (e.g. v0.4.10)' + description: 'Release Tag (e.g. v0.4.11)' required: false - default: 'v0.4.10' + default: 'v0.4.11' permissions: contents: write @@ -63,6 +63,61 @@ jobs: dist/statcraft-windows-x64-installer.exe if-no-files-found: error + build-windows-arm64: + name: Build Windows (ARM64 Cross-Compile) + runs-on: windows-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Setup Rust toolchain (ARM64 target) + uses: dtolnay/rust-toolchain@stable + with: + targets: aarch64-pc-windows-msvc + + - name: Build StatCraft for Windows ARM64 in Release Mode + shell: pwsh + run: cargo build --package statcraft_app --release --target aarch64-pc-windows-msvc -j 1 + + - name: Package Windows ARM64 Artifacts (Portable & Installer) + shell: pwsh + run: | + # 1. Portable ZIP + New-Item -ItemType Directory -Force -Path staging + Copy-Item target/aarch64-pc-windows-msvc/release/statcraft_app.exe staging/ + Copy-Item -Recurse locales staging/locales + Copy-Item README.md staging/ + Copy-Item README.ru.md staging/ + Copy-Item LICENSE-MIT staging/ + New-Item -ItemType Directory -Force -Path dist + Compress-Archive -Path staging/* -DestinationPath dist/statcraft-windows-arm64.zip + + # 2. Inno Setup Installer (ARM64) + $isccArgs = @( + "/DTargetArch=arm64", + "/DBinaryPath=..\..\target\aarch64-pc-windows-msvc\release\statcraft_app.exe", + "packaging/windows/installer.iss" + ) + if (Get-Command iscc -ErrorAction SilentlyContinue) { + iscc @isccArgs + } elseif (Test-Path "C:\Program Files (x86)\Inno Setup 6\ISCC.exe") { + & "C:\Program Files (x86)\Inno Setup 6\ISCC.exe" @isccArgs + } elseif (Test-Path "C:\Program Files\Inno Setup 6\ISCC.exe") { + & "C:\Program Files\Inno Setup 6\ISCC.exe" @isccArgs + } else { + choco install innosetup --no-progress -y + & "C:\Program Files (x86)\Inno Setup 6\ISCC.exe" @isccArgs + } + + - name: Upload Windows ARM64 Artifacts + uses: actions/upload-artifact@v4 + with: + name: statcraft-windows-arm64 + path: | + dist/statcraft-windows-arm64.zip + dist/statcraft-windows-arm64-installer.exe + if-no-files-found: error + build-linux: name: Build Linux (x64) runs-on: ubuntu-22.04 @@ -287,7 +342,7 @@ jobs: publish-release: name: Publish GitHub Release - needs: [build-windows, build-linux, build-macos-arm64, build-macos-x64] + needs: [build-windows, build-windows-arm64, build-linux, build-macos-arm64, build-macos-x64] runs-on: ubuntu-latest if: startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch' steps: diff --git a/.github/workflows/sonarcloud.yml b/.github/workflows/sonarcloud.yml new file mode 100644 index 0000000..11611e9 --- /dev/null +++ b/.github/workflows/sonarcloud.yml @@ -0,0 +1,73 @@ +name: SonarQube Cloud + +on: + push: + branches: [main] + pull_request: + types: [opened, synchronize, reopened] + +permissions: + contents: read + pull-requests: read + +env: + CARGO_TERM_COLOR: always + +jobs: + check-sonar-token: + name: Check SonarCloud Configuration + runs-on: ubuntu-latest + outputs: + has_token: ${{ steps.check.outputs.has_token }} + steps: + - name: Check SONAR_TOKEN secret + id: check + env: + SONAR_TOKEN_INPUT: ${{ secrets.SONAR_TOKEN }} + run: | + if [ -n "$SONAR_TOKEN_INPUT" ]; then + echo "has_token=true" >> "$GITHUB_OUTPUT" + else + echo "has_token=false" >> "$GITHUB_OUTPUT" + echo "SONAR_TOKEN is not configured yet. Skipping SonarQube Cloud upload." >> "$GITHUB_STEP_SUMMARY" + fi + + sonarcloud: + name: SonarQube Cloud Scan + needs: check-sonar-token + if: needs.check-sonar-token.outputs.has_token == 'true' + runs-on: ubuntu-22.04 + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Install Linux GUI Dependencies + run: | + sudo apt-get update + sudo apt-get install -y pkg-config libssl-dev libx11-dev libxcursor-dev libxrandr-dev libxi-dev libxinerama-dev libwayland-dev libxkbcommon-dev + + - name: Setup Rust toolchain + uses: dtolnay/rust-toolchain@stable + with: + components: clippy, llvm-tools-preview + + - name: Install cargo-llvm-cov + uses: taiki-e/install-action@cargo-llvm-cov + + - name: Generate Clippy JSON report + run: cargo clippy --workspace --all-targets -j 1 --message-format=json > clippy-report.json || true + + - name: Generate LCOV coverage report + run: cargo llvm-cov --workspace --lcov --output-path lcov.info -j 1 + + - name: SonarQube Cloud Scan + uses: SonarSource/sonarqube-scan-action@v6 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + with: + args: > + "-Dsonar.rust.clippy.reportPaths=clippy-report.json" + "-Dsonar.rust.lcov.reportPaths=lcov.info" diff --git a/CHANGELOG.md b/CHANGELOG.md index daf6867..ed1c4d7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,20 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 --- +## [0.4.11] - 2026-12-02 + +### Added +- **Windows ARM64 Native Builds (`aarch64-pc-windows-msvc`, Spec 038):** + - Added automated Windows ARM64 cross-compilation job (`build-windows-arm64`) to `.github/workflows/release.yml`, publishing both Portable ZIP (`statcraft-windows-arm64.zip`) and native ARM64 Inno Setup installer (`statcraft-windows-arm64-installer.exe`). + - Parameterized `packaging/windows/installer.iss` (`TargetArch` / `BinaryPath`) to enforce `ArchitecturesAllowed=arm64` and `ArchitecturesInstallIn64BitMode=arm64` on ARM64 installers while preserving `x64compatible` defaults. + - Added `check-windows-arm64` cross-compilation check to `.github/workflows/ci.yml` so every Pull Request verifies `aarch64-pc-windows-msvc` compilation. + - Updated `website/` release matrix (`release.ts`, `use-release.ts`, `download-button.tsx`) with Windows ARM64 downloads and Chromium `userAgentData` high-entropy architecture auto-detection. +- **Automated PR Review & Static Analysis (CodeRabbit & SonarQube Cloud):** + - Added `.coderabbit.yaml` (schema v2) tailored to StatCraft's Safe Rust, Zero-Panic, `DialogKit`, Zero-Hardcode i18n, and Vector-First UI rules. + - Added `sonar-project.properties` and `.github/workflows/sonarcloud.yml` running `cargo clippy` JSON diagnostics and `cargo-llvm-cov` LCOV coverage upload to SonarQube Cloud (`kobaltgit_StatCraft`), plus README status badges. + +--- + ## [0.4.10] - 2026-11-26 ### Added diff --git a/Cargo.toml b/Cargo.toml index 493d22e..f1f4e69 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -13,7 +13,7 @@ members = [ resolver = "2" [workspace.package] -version = "0.4.10" +version = "0.4.11" edition = "2021" license = "MIT OR Apache-2.0" authors = ["StatCraft Contributors"] diff --git a/README.md b/README.md index 73e19d9..b300ed5 100644 --- a/README.md +++ b/README.md @@ -25,6 +25,8 @@ + +