Skip to content

Check a Workspace in CI

Every pull request runs archidocs check, without building or publishing, so a change that breaks the Model fails before it merges.

  • The Workspace, the whole architecture kept in one repo, is in a GitHub or GitLab repo, and archidocs check passes on the default branch. See the Quick start.
  • The repo doesn’t build pull request previews yet. A preview job already checks every pull request.

Add this workflow to the repo:

.github/workflows/check.yml
# Check the Workspace on every pull request, without building or publishing.
name: Check architecture
on:
pull_request:
permissions:
contents: read
jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 24
- run: npm install --global archidocs@1
- run: archidocs check --format github --strict

--format github prints each issue as a GitHub Actions annotation. The pull request then shows the issue on the line it is about.

--strict fails the job on warnings as well as errors, so warnings don’t pile up. Drop it to fail on errors only.

The job installs archidocs@1, the latest 1.x release. To upgrade only when you choose, write the exact version you run locally:

Terminal window
archidocs version
archidocs 1.2.0 (Bundle schemaVersion 1)

Then replace archidocs@1 in the job with that version, such as archidocs@1.2.0.

So that a failing check blocks the merge:

  • GitHub: add a branch ruleset for the default branch that requires the check status check.
  • GitLab: turn on Settings › Merge requests › Pipelines must succeed.

Open a pull request that adds a field that doesn’t exist, such as color: red under a System. The job fails. On GitHub, its log shows the annotation it printed:

::error file=archidocs/digital/model.yaml,line=15,col=5,title=unknown-field::Unknown field "color" See https://archidocs.dev/docs/reference/rules/unknown-field/

The pull request’s Files changed tab shows the message on line 15. Remove the field and push: the job passes.

If the job fails with No workspace.yaml found, the Workspace is in another folder of the repo. On GitHub, set working-directory to its folder on the check step. On GitLab, add cd <folder> before archidocs check.

If the job fails on an issue, the message links the rule’s page, such as unknown-field. The page says how to fix it.

If a new release fails the job on a warning that you can’t fix yet, pin the version you ran before, as in step 2.

The check tool runs the same check over MCP. An agent that edits the Model can run it before it opens the pull request, so CI finds nothing new.

Documents Archidocs v1.4.0, the latest release.