From 0e8973c3066edbabf34519fe9b0c094836c40b61 Mon Sep 17 00:00:00 2001 From: Zeke Foppa <196249+bfops@users.noreply.github.com> Date: Tue, 5 May 2026 13:05:33 -0700 Subject: [PATCH] CI - version upgrade check happens in `ci.yml` (#4950) # Description of Changes Merged the `upgrade-version-check.yml` into `ci.yml`, and moved the business logic under `cargo ci`. I would also be very open to just removing this test until we choose to define a better suite of tests for `cargo bump-version`. # API and ABI breaking changes None. CI only. # Expected complexity level and risk 1 # Testing - [x] Ran it locally. It made a diff --------- Co-authored-by: Zeke Foppa --- .github/workflows/ci.yml | 21 +++++++++++++++ .github/workflows/upgrade-version-check.yml | 30 --------------------- tools/ci/README.md | 11 ++++++++ tools/ci/src/main.rs | 21 +++++++++++++++ 4 files changed, 53 insertions(+), 30 deletions(-) delete mode 100644 .github/workflows/upgrade-version-check.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 623c3151f..9bb00eb6f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1232,3 +1232,24 @@ jobs: # - name: Print rows in the user table # if: always() # run: spacetime sql quickstart-chat "SELECT * FROM user" + + version_upgrade_check: + runs-on: spacetimedb-new-runner-2 + steps: + - name: Checkout + uses: actions/checkout@v3 + - uses: dsherret/rust-toolchain-file@v1 + - name: Set default rust toolchain + run: rustup default $(rustup show active-toolchain | cut -d' ' -f1) + # pnpm is required for regenerating the typescript bindings + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: 20 + - uses: pnpm/action-setup@v4 + with: + run_install: true + - name: Verify that upgrade-version still works + run: cargo ci version-upgrade-check + - name: Show diff + run: git diff HEAD diff --git a/.github/workflows/upgrade-version-check.yml b/.github/workflows/upgrade-version-check.yml deleted file mode 100644 index be209c5c1..000000000 --- a/.github/workflows/upgrade-version-check.yml +++ /dev/null @@ -1,30 +0,0 @@ -name: Upgrade Version Check - -on: - pull_request: - types: [opened, synchronize] - merge_group: -permissions: read-all - -jobs: - version_upgrade_check: - runs-on: spacetimedb-new-runner-2 - steps: - - name: Checkout - uses: actions/checkout@v3 - - uses: dsherret/rust-toolchain-file@v1 - - name: Set default rust toolchain - run: rustup default $(rustup show active-toolchain | cut -d' ' -f1) - # pnpm is required for regenerating the typescript bindings - - name: Set up Node.js - uses: actions/setup-node@v4 - with: - node-version: 20 - - uses: pnpm/action-setup@v4 - with: - run_install: true - - name: Verify that upgrade-version still works - run: cargo bump-versions 123.456.789 --rust-and-cli --csharp --typescript --cpp --accept-snapshots - - name: Show diff - run: git diff HEAD - diff --git a/tools/ci/README.md b/tools/ci/README.md index dbe452243..3530ee24b 100644 --- a/tools/ci/README.md +++ b/tools/ci/README.md @@ -217,6 +217,17 @@ Usage: typescript-test - `--help`: Print help +### `version-upgrade-check` + +**Usage:** +```bash +Usage: version-upgrade-check +``` + +**Options:** + +- `--help`: Print help + ### `docs` **Usage:** diff --git a/tools/ci/src/main.rs b/tools/ci/src/main.rs index 3c31c3663..146651c10 100644 --- a/tools/ci/src/main.rs +++ b/tools/ci/src/main.rs @@ -276,6 +276,8 @@ enum CiCmd { PublishChecks, /// Runs TypeScript workspace tests and template build checks. TypescriptTest, + /// Verifies that the repository version upgrade tool still works. + VersionUpgradeCheck, /// Builds the docs site. Docs, } @@ -443,6 +445,21 @@ fn run_docs_build() -> Result<()> { Ok(()) } +fn run_version_upgrade_check() -> Result<()> { + cmd!( + "cargo", + "bump-versions", + "123.456.789", + "--rust-and-cli", + "--csharp", + "--typescript", + "--cpp", + "--accept-snapshots" + ) + .run()?; + Ok(()) +} + fn main() -> Result<()> { env_logger::init(); @@ -711,6 +728,10 @@ fn main() -> Result<()> { run_typescript_tests()?; } + Some(CiCmd::VersionUpgradeCheck) => { + run_version_upgrade_check()?; + } + Some(CiCmd::Docs) => { run_docs_build()?; }