mirror of
https://github.com/clockworklabs/SpacetimeDB.git
synced 2026-05-15 04:08:02 -04:00
3d1fa97c63
* [bfops/ci-on-master]: Run CI on `master` commits * [bfops/ci-on-master]: tweak --------- Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
53 lines
1.8 KiB
YAML
53 lines
1.8 KiB
YAML
on:
|
|
pull_request:
|
|
push:
|
|
branches:
|
|
- master
|
|
merge_group:
|
|
workflow_dispatch:
|
|
inputs:
|
|
ref:
|
|
description: 'SpacetimeDB ref'
|
|
required: false
|
|
default: ''
|
|
permissions: read-all
|
|
|
|
name: Check CLI docs
|
|
|
|
jobs:
|
|
cli_docs:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Find Git ref
|
|
shell: bash
|
|
run: |
|
|
echo "GIT_REF=${{ github.event.inputs.ref || 'master' }}" >>"$GITHUB_ENV"
|
|
- name: Checkout sources
|
|
uses: actions/checkout@v4
|
|
with:
|
|
repository: clockworklabs/SpacetimeDB
|
|
ref: ${{ env.GIT_REF }}
|
|
- uses: dsherret/rust-toolchain-file@v1
|
|
- name: Checkout docs
|
|
uses: actions/checkout@v4
|
|
with:
|
|
path: spacetime-docs
|
|
- name: Check for docs change
|
|
run: |
|
|
cargo run --features markdown-docs -p spacetimedb-cli > ../spacetime-docs/docs/cli-reference.md
|
|
cd spacetime-docs
|
|
# This is needed because our website doesn't render markdown quite properly.
|
|
# See the README in spacetime-docs for more details.
|
|
sed -i'' -E 's!^(##) `(.*)`$!\1 \2!' docs/cli-reference.md
|
|
sed -i'' -E 's!^(######) \*\*(.*)\*\*$!\1 <b>\2</b>!' docs/cli-reference.md
|
|
git status
|
|
if git diff --exit-code HEAD; then
|
|
echo "No docs changes detected"
|
|
else
|
|
echo "It looks like the CLI docs have changed."
|
|
echo "These docs are expected to match exactly the helptext generated by the CLI in SpacetimeDB (${{env.GIT_REF}})."
|
|
echo "Once a corresponding change has merged in SpacetimeDB, re-run this check."
|
|
echo "See https://github.com/clockworklabs/spacetime-docs/#cli-reference-section for more info on how to generate these docs from SpacetimeDB."
|
|
exit 1
|
|
fi
|