From 8be3eb25169dcdbc54bb5c20ea4bb8cf84cccc00 Mon Sep 17 00:00:00 2001 From: koba-e964 <3303362+koba-e964@users.noreply.github.com> Date: Sun, 5 Jul 2026 14:20:29 +0900 Subject: [PATCH 1/4] ci: add Rust checks and executable size gates Why: - Executable size matters for this project and should be checked automatically on pull requests. - The repository also needs baseline Rust CI coverage before main progresses through PRs. What: - Add a GitHub Actions CI workflow for cargo fmt, clippy, and tests. - Add Linux, macOS, and Windows release executable-size checks with platform-specific byte thresholds. - Update progress tracking and task notes for auto-check-executable-sizes. Impact: - Pull requests and pushes to main now run Rust CI and size gates. - Local release binary size is 676032 bytes, below the Linux threshold of 900000. - Verified with cargo fmt --check, cargo clippy --locked --all-targets -- -D warnings, cargo test --locked, cargo build --release --locked, and the progress validation command. - actionlint was not available locally. Prompt: - Now go on to auto-check-executable-sizes. - Yes, but I want general CI checks for Rust too. --- .github/workflows/ci.yml | 50 ++++++++++++++++++ .../feature_list.json | 22 ++++++++ .../auto-check-executable-sizes/plan.md | 51 +++++++++++++++++++ .../auto-check-executable-sizes/research.md | 40 +++++++++++++++ progress.toml | 4 +- 5 files changed, 165 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/ci.yml create mode 100644 codex-notes/auto-check-executable-sizes/feature_list.json create mode 100644 codex-notes/auto-check-executable-sizes/plan.md create mode 100644 codex-notes/auto-check-executable-sizes/research.md diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..349482f --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,50 @@ +name: ci + +on: + pull_request: + push: + branches: + - main + +jobs: + rust: + name: rust + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Check formatting + run: cargo fmt --check + - name: Run clippy + run: cargo clippy --locked --all-targets -- -D warnings + - name: Run tests + run: cargo test --locked + + executable-size: + name: executable-size-${{ matrix.name }} + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + include: + - name: linux + os: ubuntu-latest + exe: target/release/git-zcrypt + max_size: 900000 + - name: macos + os: macos-latest + exe: target/release/git-zcrypt + max_size: 1200000 + - name: windows + os: windows-latest + exe: target/release/git-zcrypt.exe + max_size: 1600000 + steps: + - uses: actions/checkout@v4 + - name: Build release executable + run: cargo build --release --locked + - name: Check executable size + env: + EXE: ${{ matrix.exe }} + MAX_SIZE: ${{ matrix.max_size }} + run: | + ruby -e 'path = ENV.fetch("EXE"); max = Integer(ENV.fetch("MAX_SIZE")); size = File.size(path); puts "#{path}: #{size} bytes (limit #{max})"; exit(size <= max ? 0 : 1)' diff --git a/codex-notes/auto-check-executable-sizes/feature_list.json b/codex-notes/auto-check-executable-sizes/feature_list.json new file mode 100644 index 0000000..e26fb83 --- /dev/null +++ b/codex-notes/auto-check-executable-sizes/feature_list.json @@ -0,0 +1,22 @@ +{ + "features": [ + { + "id": "add-rust-ci", + "description": "Add a GitHub Actions workflow that runs Rust formatting, clippy, and tests.", + "validation": "rg -q 'cargo fmt --check' .github/workflows/ci.yml && rg -q 'cargo clippy --locked --all-targets -- -D warnings' .github/workflows/ci.yml && rg -q 'cargo test --locked' .github/workflows/ci.yml", + "passes": true + }, + { + "id": "add-size-gate", + "description": "Add a release executable-size matrix for Linux, macOS, and Windows with platform-specific thresholds.", + "validation": "rg -q 'cargo build --release --locked' .github/workflows/ci.yml && rg -q 'File.size' .github/workflows/ci.yml && rg -q 'max_size: 900000' .github/workflows/ci.yml && rg -q 'max_size: 1200000' .github/workflows/ci.yml && rg -q 'max_size: 1600000' .github/workflows/ci.yml", + "passes": true + }, + { + "id": "update-progress", + "description": "Replace the placeholder auto-check-executable-sizes progress validation with checks for the CI workflow.", + "validation": "rg -q 'auto-check-executable-sizes' progress.toml && ! rg -q 'validation = \"false\"' progress.toml", + "passes": true + } + ] +} diff --git a/codex-notes/auto-check-executable-sizes/plan.md b/codex-notes/auto-check-executable-sizes/plan.md new file mode 100644 index 0000000..844e552 --- /dev/null +++ b/codex-notes/auto-check-executable-sizes/plan.md @@ -0,0 +1,51 @@ +# Plan: auto-check-executable-sizes + +## Overview + +Add a GitHub Actions CI workflow with standard Rust checks and a release executable-size gate for Linux, macOS, and Windows. + +## Files To Change + +- `.github/workflows/ci.yml` +- `progress.toml` +- `codex-notes/auto-check-executable-sizes/research.md` +- `codex-notes/auto-check-executable-sizes/plan.md` +- `codex-notes/auto-check-executable-sizes/feature_list.json` + +## Implementation Steps + +1. Create a workflow triggered by pull requests and pushes to `main`. +2. Add a `rust` job on `ubuntu-latest` that runs: + - `cargo fmt --check` + - `cargo clippy --locked --all-targets -- -D warnings` + - `cargo test --locked` +3. Add an `executable-size` job with a matrix for `ubuntu-latest`, `macos-latest`, and `windows-latest`. +4. Use only `actions/checkout` by tag, which is allowed by the GitHub Actions guardrail. +5. Build each platform executable with `cargo build --release --locked`. +6. Measure executable byte size with Ruby's `File.size`, available on GitHub-hosted runners and portable across the matrix. +7. Set initial thresholds with headroom for hosted-runner toolchain variation: + - Linux: `900000` + - macOS: `1200000` + - Windows: `1600000` +8. Update `progress.toml` validation to check for the workflow, general Rust CI commands, platform thresholds, portable byte-size measurement, and locked release build. + +## Alternatives Considered + +- Shell `stat`: rejected because GNU and BSD flags differ. +- Bash `wc -c < file`: plausible, but more fragile on Windows than a Ruby one-liner. +- A separate executable-size workflow: rejected after user clarified that general Rust CI checks should be included too. +- Third-party Rust toolchain actions: unnecessary because GitHub-hosted runners already include Rust here, and avoiding third-party actions keeps workflow pinning simple. + +## Risks + +- Hosted runner toolchain updates can change binary size. The selected thresholds include headroom above the recent local release size while still catching large regressions. +- Windows binary size is not locally measured here, so its threshold is intentionally more generous. + +## Test Strategy + +- Run `cargo fmt --check`. +- Run `cargo clippy --locked --all-targets -- -D warnings`. +- Run `cargo test --locked`. +- Run `cargo build --release --locked`. +- Measure the local release binary size. +- Run the updated `progress.toml` validation command. diff --git a/codex-notes/auto-check-executable-sizes/research.md b/codex-notes/auto-check-executable-sizes/research.md new file mode 100644 index 0000000..9cb5122 --- /dev/null +++ b/codex-notes/auto-check-executable-sizes/research.md @@ -0,0 +1,40 @@ +# Research: auto-check-executable-sizes + +## Relevant Files + +- `progress.toml`: tracks task completion. `auto-check-executable-sizes` currently has `validation = "false"` and `passes = false`. +- `Cargo.toml`: defines package name `git-zcrypt` and release profile optimized for size with `opt-level = "z"`, `lto = "fat"`, and `codegen-units = 1`. +- `.github/workflows/`: absent before this task, so no existing CI conventions need to be preserved. +- `README.md`: install instructions already use `cargo build --release`; no size policy is documented there. + +## Execution Flow + +- General Rust CI should check formatting, lints, and tests. +- Release executable size CI should build the binary on each target platform. +- After `cargo build --release --locked`, the workflow can read the built executable byte size from `target/release/git-zcrypt` or `target/release/git-zcrypt.exe`. +- The job fails when the measured byte size is above a platform-specific threshold. + +## Data And Invariants + +- The package executable name is `git-zcrypt`. +- Windows uses the `.exe` suffix; Linux and macOS do not. +- Thresholds should be plain byte counts and not comma-separated. +- The check should print the measured size for diagnostics. + +## Existing Patterns + +- Existing task validation commands in `progress.toml` use `rg` checks and concrete command-line validation. +- GitHub Actions security rules allow `actions/*` by tag. Third-party actions must be pinned, so the workflow should avoid third-party actions. + +## Pitfalls + +- GNU `stat -c%s` is not portable to macOS; BSD `stat -f%z` is not portable to Linux. +- Windows shell differences can make PowerShell/Bash-specific syntax fragile. +- A threshold too close to the current executable size can create CI noise from toolchain variation. + +## Constraints + +- Use GitHub Actions. +- Include general Rust CI checks. +- Decide executable-size thresholds for each platform. +- Keep the PR scoped to this single task. diff --git a/progress.toml b/progress.toml index 1e8b2f9..a6e7f74 100644 --- a/progress.toml +++ b/progress.toml @@ -37,5 +37,5 @@ passes = true [[items]] id = "auto-check-executable-sizes" description = "executable sizes matter. Use GitHub Actions to auto-check. You must decide the threshold for each platform" -validation = "false" -passes = false +validation = "rg -q '^name: ci$' .github/workflows/ci.yml && rg -q 'pull_request:' .github/workflows/ci.yml && rg -q 'cargo fmt --check' .github/workflows/ci.yml && rg -q 'cargo clippy --locked --all-targets -- -D warnings' .github/workflows/ci.yml && rg -q 'cargo test --locked' .github/workflows/ci.yml && rg -q 'cargo build --release --locked' .github/workflows/ci.yml && rg -q 'File.size' .github/workflows/ci.yml && rg -q 'max_size: 900000' .github/workflows/ci.yml && rg -q 'max_size: 1200000' .github/workflows/ci.yml && rg -q 'max_size: 1600000' .github/workflows/ci.yml && rg -q 'codex-notes/auto-check-executable-sizes/plan.md' codex-notes/auto-check-executable-sizes/plan.md" +passes = true From 333fe7272b9700b686cef6b0f0a11e75f3f2c6f9 Mon Sep 17 00:00:00 2001 From: koba-e964 <3303362+koba-e964@users.noreply.github.com> Date: Sun, 5 Jul 2026 14:29:56 +0900 Subject: [PATCH 2/4] ci: use latest checkout action Why: - Workflow dependencies should use the latest compatible stable action tags. - actions/checkout v7 is available and should be used instead of the older v4 tag. What: - Update CI jobs to use actions/checkout@v7. - Make progress validation require checkout v7. - Update task notes to record the latest-action requirement. Impact: - CI behavior stays the same while using the current checkout action. - No code or dependency changes; release executable size remains 676032 bytes. - Verified actions/checkout v7 via git ls-remote tags. - Verified with progress validation and git diff --check. Prompt: - action/checkout has v7, but you ignore the instructions and stick to using v4. --- .github/workflows/ci.yml | 4 ++-- codex-notes/auto-check-executable-sizes/feature_list.json | 2 +- codex-notes/auto-check-executable-sizes/plan.md | 3 ++- codex-notes/auto-check-executable-sizes/research.md | 2 +- progress.toml | 2 +- 5 files changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 349482f..dcbde71 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,7 +11,7 @@ jobs: name: rust runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v7 - name: Check formatting run: cargo fmt --check - name: Run clippy @@ -39,7 +39,7 @@ jobs: exe: target/release/git-zcrypt.exe max_size: 1600000 steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v7 - name: Build release executable run: cargo build --release --locked - name: Check executable size diff --git a/codex-notes/auto-check-executable-sizes/feature_list.json b/codex-notes/auto-check-executable-sizes/feature_list.json index e26fb83..ad4ad06 100644 --- a/codex-notes/auto-check-executable-sizes/feature_list.json +++ b/codex-notes/auto-check-executable-sizes/feature_list.json @@ -3,7 +3,7 @@ { "id": "add-rust-ci", "description": "Add a GitHub Actions workflow that runs Rust formatting, clippy, and tests.", - "validation": "rg -q 'cargo fmt --check' .github/workflows/ci.yml && rg -q 'cargo clippy --locked --all-targets -- -D warnings' .github/workflows/ci.yml && rg -q 'cargo test --locked' .github/workflows/ci.yml", + "validation": "rg -q 'actions/checkout@v7' .github/workflows/ci.yml && rg -q 'cargo fmt --check' .github/workflows/ci.yml && rg -q 'cargo clippy --locked --all-targets -- -D warnings' .github/workflows/ci.yml && rg -q 'cargo test --locked' .github/workflows/ci.yml", "passes": true }, { diff --git a/codex-notes/auto-check-executable-sizes/plan.md b/codex-notes/auto-check-executable-sizes/plan.md index 844e552..824eec8 100644 --- a/codex-notes/auto-check-executable-sizes/plan.md +++ b/codex-notes/auto-check-executable-sizes/plan.md @@ -20,7 +20,7 @@ Add a GitHub Actions CI workflow with standard Rust checks and a release executa - `cargo clippy --locked --all-targets -- -D warnings` - `cargo test --locked` 3. Add an `executable-size` job with a matrix for `ubuntu-latest`, `macos-latest`, and `windows-latest`. -4. Use only `actions/checkout` by tag, which is allowed by the GitHub Actions guardrail. +4. Use `actions/checkout@v7`, the latest verified stable tag, which is allowed by the GitHub Actions guardrail. 5. Build each platform executable with `cargo build --release --locked`. 6. Measure executable byte size with Ruby's `File.size`, available on GitHub-hosted runners and portable across the matrix. 7. Set initial thresholds with headroom for hosted-runner toolchain variation: @@ -35,6 +35,7 @@ Add a GitHub Actions CI workflow with standard Rust checks and a release executa - Bash `wc -c < file`: plausible, but more fragile on Windows than a Ruby one-liner. - A separate executable-size workflow: rejected after user clarified that general Rust CI checks should be included too. - Third-party Rust toolchain actions: unnecessary because GitHub-hosted runners already include Rust here, and avoiding third-party actions keeps workflow pinning simple. +- Older `actions/checkout` tags: rejected because workflow dependencies should use the latest compatible tag unless the user requests otherwise. ## Risks diff --git a/codex-notes/auto-check-executable-sizes/research.md b/codex-notes/auto-check-executable-sizes/research.md index 9cb5122..b8cbab6 100644 --- a/codex-notes/auto-check-executable-sizes/research.md +++ b/codex-notes/auto-check-executable-sizes/research.md @@ -24,7 +24,7 @@ ## Existing Patterns - Existing task validation commands in `progress.toml` use `rg` checks and concrete command-line validation. -- GitHub Actions security rules allow `actions/*` by tag. Third-party actions must be pinned, so the workflow should avoid third-party actions. +- GitHub Actions security rules allow `actions/*` by tag. Use the latest compatible `actions/*` tag after verification. Third-party actions must be pinned, so the workflow should avoid third-party actions. ## Pitfalls diff --git a/progress.toml b/progress.toml index a6e7f74..3f75e3a 100644 --- a/progress.toml +++ b/progress.toml @@ -37,5 +37,5 @@ passes = true [[items]] id = "auto-check-executable-sizes" description = "executable sizes matter. Use GitHub Actions to auto-check. You must decide the threshold for each platform" -validation = "rg -q '^name: ci$' .github/workflows/ci.yml && rg -q 'pull_request:' .github/workflows/ci.yml && rg -q 'cargo fmt --check' .github/workflows/ci.yml && rg -q 'cargo clippy --locked --all-targets -- -D warnings' .github/workflows/ci.yml && rg -q 'cargo test --locked' .github/workflows/ci.yml && rg -q 'cargo build --release --locked' .github/workflows/ci.yml && rg -q 'File.size' .github/workflows/ci.yml && rg -q 'max_size: 900000' .github/workflows/ci.yml && rg -q 'max_size: 1200000' .github/workflows/ci.yml && rg -q 'max_size: 1600000' .github/workflows/ci.yml && rg -q 'codex-notes/auto-check-executable-sizes/plan.md' codex-notes/auto-check-executable-sizes/plan.md" +validation = "rg -q '^name: ci$' .github/workflows/ci.yml && rg -q 'pull_request:' .github/workflows/ci.yml && rg -q 'actions/checkout@v7' .github/workflows/ci.yml && rg -q 'cargo fmt --check' .github/workflows/ci.yml && rg -q 'cargo clippy --locked --all-targets -- -D warnings' .github/workflows/ci.yml && rg -q 'cargo test --locked' .github/workflows/ci.yml && rg -q 'cargo build --release --locked' .github/workflows/ci.yml && rg -q 'File.size' .github/workflows/ci.yml && rg -q 'max_size: 900000' .github/workflows/ci.yml && rg -q 'max_size: 1200000' .github/workflows/ci.yml && rg -q 'max_size: 1600000' .github/workflows/ci.yml && rg -q 'codex-notes/auto-check-executable-sizes/plan.md' codex-notes/auto-check-executable-sizes/plan.md" passes = true From 4be679b277d3d2cc6365202ca491fcfe99db9c38 Mon Sep 17 00:00:00 2001 From: koba-e964 <3303362+koba-e964@users.noreply.github.com> Date: Sun, 5 Jul 2026 18:38:33 +0900 Subject: [PATCH 3/4] ci: tighten executable size thresholds Why: - GitHub Actions run 28735183007 reported actual executable sizes for all target platforms. - The previous thresholds assumed Windows would be largest, but the run showed Windows is smallest. What: - Set Linux threshold to 850000 based on measured size 768480. - Set macOS threshold to 750000 based on measured size 676032. - Set Windows threshold to 550000 based on measured size 476672. - Update progress validation and task notes to document the observed-size basis. Impact: - Size gates now reflect real CI runner output with modest headroom. - No code or dependency changes; local release executable size remains 676032 bytes. - Verified with progress validation and git diff --check. Prompt: - windows exe is the smallest, you better reflect these on the thresholds. --- .github/workflows/ci.yml | 6 +++--- .../auto-check-executable-sizes/feature_list.json | 2 +- codex-notes/auto-check-executable-sizes/plan.md | 13 ++++++------- codex-notes/auto-check-executable-sizes/research.md | 1 + progress.toml | 2 +- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index dcbde71..b385727 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -29,15 +29,15 @@ jobs: - name: linux os: ubuntu-latest exe: target/release/git-zcrypt - max_size: 900000 + max_size: 850000 - name: macos os: macos-latest exe: target/release/git-zcrypt - max_size: 1200000 + max_size: 750000 - name: windows os: windows-latest exe: target/release/git-zcrypt.exe - max_size: 1600000 + max_size: 550000 steps: - uses: actions/checkout@v7 - name: Build release executable diff --git a/codex-notes/auto-check-executable-sizes/feature_list.json b/codex-notes/auto-check-executable-sizes/feature_list.json index ad4ad06..ef8872b 100644 --- a/codex-notes/auto-check-executable-sizes/feature_list.json +++ b/codex-notes/auto-check-executable-sizes/feature_list.json @@ -9,7 +9,7 @@ { "id": "add-size-gate", "description": "Add a release executable-size matrix for Linux, macOS, and Windows with platform-specific thresholds.", - "validation": "rg -q 'cargo build --release --locked' .github/workflows/ci.yml && rg -q 'File.size' .github/workflows/ci.yml && rg -q 'max_size: 900000' .github/workflows/ci.yml && rg -q 'max_size: 1200000' .github/workflows/ci.yml && rg -q 'max_size: 1600000' .github/workflows/ci.yml", + "validation": "rg -q 'cargo build --release --locked' .github/workflows/ci.yml && rg -q 'File.size' .github/workflows/ci.yml && rg -q 'max_size: 850000' .github/workflows/ci.yml && rg -q 'max_size: 750000' .github/workflows/ci.yml && rg -q 'max_size: 550000' .github/workflows/ci.yml", "passes": true }, { diff --git a/codex-notes/auto-check-executable-sizes/plan.md b/codex-notes/auto-check-executable-sizes/plan.md index 824eec8..cf2b8e1 100644 --- a/codex-notes/auto-check-executable-sizes/plan.md +++ b/codex-notes/auto-check-executable-sizes/plan.md @@ -23,10 +23,10 @@ Add a GitHub Actions CI workflow with standard Rust checks and a release executa 4. Use `actions/checkout@v7`, the latest verified stable tag, which is allowed by the GitHub Actions guardrail. 5. Build each platform executable with `cargo build --release --locked`. 6. Measure executable byte size with Ruby's `File.size`, available on GitHub-hosted runners and portable across the matrix. -7. Set initial thresholds with headroom for hosted-runner toolchain variation: - - Linux: `900000` - - macOS: `1200000` - - Windows: `1600000` +7. Set thresholds from GitHub Actions run `28735183007`, with modest headroom over measured sizes: + - Linux: measured `768480`, threshold `850000` + - macOS: measured `676032`, threshold `750000` + - Windows: measured `476672`, threshold `550000` 8. Update `progress.toml` validation to check for the workflow, general Rust CI commands, platform thresholds, portable byte-size measurement, and locked release build. ## Alternatives Considered @@ -39,8 +39,7 @@ Add a GitHub Actions CI workflow with standard Rust checks and a release executa ## Risks -- Hosted runner toolchain updates can change binary size. The selected thresholds include headroom above the recent local release size while still catching large regressions. -- Windows binary size is not locally measured here, so its threshold is intentionally more generous. +- Hosted runner toolchain updates can change binary size. The selected thresholds include modest headroom above measured GitHub Actions sizes while still catching large regressions. ## Test Strategy @@ -48,5 +47,5 @@ Add a GitHub Actions CI workflow with standard Rust checks and a release executa - Run `cargo clippy --locked --all-targets -- -D warnings`. - Run `cargo test --locked`. - Run `cargo build --release --locked`. -- Measure the local release binary size. +- Compare thresholds to GitHub Actions run `28735183007` executable sizes. - Run the updated `progress.toml` validation command. diff --git a/codex-notes/auto-check-executable-sizes/research.md b/codex-notes/auto-check-executable-sizes/research.md index b8cbab6..71c31aa 100644 --- a/codex-notes/auto-check-executable-sizes/research.md +++ b/codex-notes/auto-check-executable-sizes/research.md @@ -19,6 +19,7 @@ - The package executable name is `git-zcrypt`. - Windows uses the `.exe` suffix; Linux and macOS do not. - Thresholds should be plain byte counts and not comma-separated. +- Thresholds should be based on observed GitHub Actions runner sizes once those measurements are available. - The check should print the measured size for diagnostics. ## Existing Patterns diff --git a/progress.toml b/progress.toml index 3f75e3a..ebb9d25 100644 --- a/progress.toml +++ b/progress.toml @@ -37,5 +37,5 @@ passes = true [[items]] id = "auto-check-executable-sizes" description = "executable sizes matter. Use GitHub Actions to auto-check. You must decide the threshold for each platform" -validation = "rg -q '^name: ci$' .github/workflows/ci.yml && rg -q 'pull_request:' .github/workflows/ci.yml && rg -q 'actions/checkout@v7' .github/workflows/ci.yml && rg -q 'cargo fmt --check' .github/workflows/ci.yml && rg -q 'cargo clippy --locked --all-targets -- -D warnings' .github/workflows/ci.yml && rg -q 'cargo test --locked' .github/workflows/ci.yml && rg -q 'cargo build --release --locked' .github/workflows/ci.yml && rg -q 'File.size' .github/workflows/ci.yml && rg -q 'max_size: 900000' .github/workflows/ci.yml && rg -q 'max_size: 1200000' .github/workflows/ci.yml && rg -q 'max_size: 1600000' .github/workflows/ci.yml && rg -q 'codex-notes/auto-check-executable-sizes/plan.md' codex-notes/auto-check-executable-sizes/plan.md" +validation = "rg -q '^name: ci$' .github/workflows/ci.yml && rg -q 'pull_request:' .github/workflows/ci.yml && rg -q 'actions/checkout@v7' .github/workflows/ci.yml && rg -q 'cargo fmt --check' .github/workflows/ci.yml && rg -q 'cargo clippy --locked --all-targets -- -D warnings' .github/workflows/ci.yml && rg -q 'cargo test --locked' .github/workflows/ci.yml && rg -q 'cargo build --release --locked' .github/workflows/ci.yml && rg -q 'File.size' .github/workflows/ci.yml && rg -q 'max_size: 850000' .github/workflows/ci.yml && rg -q 'max_size: 750000' .github/workflows/ci.yml && rg -q 'max_size: 550000' .github/workflows/ci.yml && rg -q 'codex-notes/auto-check-executable-sizes/plan.md' codex-notes/auto-check-executable-sizes/plan.md" passes = true From 31734161379d5181b1eadf8d567e11d7490de091 Mon Sep 17 00:00:00 2001 From: koba-e964 <3303362+koba-e964@users.noreply.github.com> Date: Sun, 5 Jul 2026 18:49:02 +0900 Subject: [PATCH 4/4] ci: add scheduled and manual triggers Why: - CI should run periodically without waiting for code changes. - The workflow should also be runnable on demand from GitHub Actions. What: - Add weekly Monday 00:00 UTC schedule trigger. - Add GitHub Actions manual workflow_dispatch trigger. - Update progress validation and task notes to require both triggers. Impact: - CI runs on pull requests, pushes to main, weekly schedule, and manual dispatch. - No code or dependency changes; local release executable size remains 676032 bytes. - Verified with progress validation and git diff --check. - actionlint was not available locally. Prompt: - I want ci (i) periodically run (once per week) and (ii) run on MY discretion (dispatch_workflow). --- .github/workflows/ci.yml | 3 +++ codex-notes/auto-check-executable-sizes/feature_list.json | 6 ++++++ codex-notes/auto-check-executable-sizes/plan.md | 3 ++- codex-notes/auto-check-executable-sizes/research.md | 1 + progress.toml | 2 +- 5 files changed, 13 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b385727..37da42e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,6 +1,9 @@ name: ci on: + workflow_dispatch: + schedule: + - cron: "0 0 * * 1" pull_request: push: branches: diff --git a/codex-notes/auto-check-executable-sizes/feature_list.json b/codex-notes/auto-check-executable-sizes/feature_list.json index ef8872b..0f1b6e6 100644 --- a/codex-notes/auto-check-executable-sizes/feature_list.json +++ b/codex-notes/auto-check-executable-sizes/feature_list.json @@ -6,6 +6,12 @@ "validation": "rg -q 'actions/checkout@v7' .github/workflows/ci.yml && rg -q 'cargo fmt --check' .github/workflows/ci.yml && rg -q 'cargo clippy --locked --all-targets -- -D warnings' .github/workflows/ci.yml && rg -q 'cargo test --locked' .github/workflows/ci.yml", "passes": true }, + { + "id": "add-scheduled-and-manual-triggers", + "description": "Configure CI to run weekly and on manual GitHub Actions dispatch.", + "validation": "rg -q 'workflow_dispatch:' .github/workflows/ci.yml && rg -q 'schedule:' .github/workflows/ci.yml && rg -q 'cron: \"0 0 \\* \\* 1\"' .github/workflows/ci.yml", + "passes": true + }, { "id": "add-size-gate", "description": "Add a release executable-size matrix for Linux, macOS, and Windows with platform-specific thresholds.", diff --git a/codex-notes/auto-check-executable-sizes/plan.md b/codex-notes/auto-check-executable-sizes/plan.md index cf2b8e1..e4c3730 100644 --- a/codex-notes/auto-check-executable-sizes/plan.md +++ b/codex-notes/auto-check-executable-sizes/plan.md @@ -14,7 +14,7 @@ Add a GitHub Actions CI workflow with standard Rust checks and a release executa ## Implementation Steps -1. Create a workflow triggered by pull requests and pushes to `main`. +1. Create a workflow triggered by pull requests, pushes to `main`, manual `workflow_dispatch`, and a weekly schedule. 2. Add a `rust` job on `ubuntu-latest` that runs: - `cargo fmt --check` - `cargo clippy --locked --all-targets -- -D warnings` @@ -28,6 +28,7 @@ Add a GitHub Actions CI workflow with standard Rust checks and a release executa - macOS: measured `676032`, threshold `750000` - Windows: measured `476672`, threshold `550000` 8. Update `progress.toml` validation to check for the workflow, general Rust CI commands, platform thresholds, portable byte-size measurement, and locked release build. +9. Validate the workflow includes the manual trigger and weekly Monday 00:00 UTC cron schedule. ## Alternatives Considered diff --git a/codex-notes/auto-check-executable-sizes/research.md b/codex-notes/auto-check-executable-sizes/research.md index 71c31aa..ddc24a8 100644 --- a/codex-notes/auto-check-executable-sizes/research.md +++ b/codex-notes/auto-check-executable-sizes/research.md @@ -11,6 +11,7 @@ - General Rust CI should check formatting, lints, and tests. - Release executable size CI should build the binary on each target platform. +- CI should also be available by manual `workflow_dispatch` and should run periodically once per week. - After `cargo build --release --locked`, the workflow can read the built executable byte size from `target/release/git-zcrypt` or `target/release/git-zcrypt.exe`. - The job fails when the measured byte size is above a platform-specific threshold. diff --git a/progress.toml b/progress.toml index ebb9d25..c0ed7c3 100644 --- a/progress.toml +++ b/progress.toml @@ -37,5 +37,5 @@ passes = true [[items]] id = "auto-check-executable-sizes" description = "executable sizes matter. Use GitHub Actions to auto-check. You must decide the threshold for each platform" -validation = "rg -q '^name: ci$' .github/workflows/ci.yml && rg -q 'pull_request:' .github/workflows/ci.yml && rg -q 'actions/checkout@v7' .github/workflows/ci.yml && rg -q 'cargo fmt --check' .github/workflows/ci.yml && rg -q 'cargo clippy --locked --all-targets -- -D warnings' .github/workflows/ci.yml && rg -q 'cargo test --locked' .github/workflows/ci.yml && rg -q 'cargo build --release --locked' .github/workflows/ci.yml && rg -q 'File.size' .github/workflows/ci.yml && rg -q 'max_size: 850000' .github/workflows/ci.yml && rg -q 'max_size: 750000' .github/workflows/ci.yml && rg -q 'max_size: 550000' .github/workflows/ci.yml && rg -q 'codex-notes/auto-check-executable-sizes/plan.md' codex-notes/auto-check-executable-sizes/plan.md" +validation = "rg -q '^name: ci$' .github/workflows/ci.yml && rg -q 'workflow_dispatch:' .github/workflows/ci.yml && rg -q 'schedule:' .github/workflows/ci.yml && rg -q 'cron: \"0 0 \\* \\* 1\"' .github/workflows/ci.yml && rg -q 'pull_request:' .github/workflows/ci.yml && rg -q 'actions/checkout@v7' .github/workflows/ci.yml && rg -q 'cargo fmt --check' .github/workflows/ci.yml && rg -q 'cargo clippy --locked --all-targets -- -D warnings' .github/workflows/ci.yml && rg -q 'cargo test --locked' .github/workflows/ci.yml && rg -q 'cargo build --release --locked' .github/workflows/ci.yml && rg -q 'File.size' .github/workflows/ci.yml && rg -q 'max_size: 850000' .github/workflows/ci.yml && rg -q 'max_size: 750000' .github/workflows/ci.yml && rg -q 'max_size: 550000' .github/workflows/ci.yml && rg -q 'codex-notes/auto-check-executable-sizes/plan.md' codex-notes/auto-check-executable-sizes/plan.md" passes = true