mirror of
https://github.com/clockworklabs/SpacetimeDB.git
synced 2026-05-06 07:26:43 -04:00
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 <bfops@users.noreply.github.com>
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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:**
|
||||
|
||||
@@ -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()?;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user