Repository navigation
Keep CLI release guidance synchronized and detect stale documentation #43
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| pull_request: | |
| push: | |
| branches: | |
| - main | |
| permissions: | |
| contents: read | |
| jobs: | |
| baseline: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check out repository | |
| uses: actions/checkout@v7 | |
| with: | |
| submodules: recursive | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v7 | |
| with: | |
| node-version: 22.14.0 | |
| cache: npm | |
| - name: Read pinned CLI documentation contract | |
| id: cli | |
| run: | | |
| node --input-type=module -e 'import { documentationContract } from "./scripts/docs-validation.config.mjs"; console.log(`revision=${documentationContract.cli.revision}`)' >> "$GITHUB_OUTPUT" | |
| - name: Check out pinned Stack CLI | |
| uses: actions/checkout@v7 | |
| with: | |
| repository: stack-sh/cli | |
| ref: ${{ steps.cli.outputs.revision }} | |
| path: .stack-cli | |
| persist-credentials: false | |
| - name: Read pinned example corpus contract | |
| id: corpus | |
| run: | | |
| node --input-type=module -e 'import { exampleCorpusSource } from "./scripts/example-corpus.config.mjs"; console.log(`revision=${exampleCorpusSource.revision}`)' >> "$GITHUB_OUTPUT" | |
| - name: Check out pinned Stack example corpus | |
| uses: actions/checkout@v7 | |
| with: | |
| repository: stack-sh/specification | |
| ref: ${{ steps.corpus.outputs.revision }} | |
| path: .stack-specification | |
| persist-credentials: false | |
| - name: Install minimum supported Rust | |
| run: rustup toolchain install 1.85.0 --profile minimal | |
| - name: Build pinned Stack CLI | |
| run: cargo +1.85.0 build --manifest-path .stack-cli/Cargo.toml --locked | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Check formatting | |
| run: npm run format:check | |
| - name: Run lint | |
| run: npm run lint | |
| - name: Run tests | |
| run: npm test | |
| - name: Check latest published CLI release | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| run: npm run docs:release:check | |
| - name: Verify pinned example snapshots | |
| env: | |
| STACK_SPECIFICATION_ROOT: ${{ github.workspace }}/.stack-specification | |
| run: npm run examples:check:source | |
| - name: Smoke test documentation CLI examples | |
| env: | |
| STACK_CLI_BIN: ${{ github.workspace }}/.stack-cli/target/debug/stack | |
| run: npm run docs:smoke | |
| - name: Verify and smoke test the published CLI archive | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| run: | | |
| version=$(node --input-type=module -e 'import { documentationContract as c } from "./scripts/docs-validation.config.mjs"; console.log(c.cli.version)') | |
| archive="stack-v${version}-x86_64-unknown-linux-gnu.tar.gz" | |
| mkdir .stack-release | |
| gh release download "v${version}" --repo stack-sh/cli --pattern "$archive" --dir .stack-release | |
| gh attestation verify ".stack-release/$archive" --repo stack-sh/cli | |
| tar -xzf ".stack-release/$archive" -C .stack-release | |
| STACK_CLI_BIN="$PWD/.stack-release/stack-v${version}-x86_64-unknown-linux-gnu/stack" npm run docs:smoke | |
| - name: Build playground | |
| run: npm run build | |
| - name: Check Cloudflare deployment bundle | |
| run: npm run cloudflare:check |