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.
Before you start
Section titled “Before you start”- The Workspace, the whole architecture kept in one repo, is in a GitHub or GitLab repo, and
archidocs checkpasses 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.
1. Add the job
Section titled “1. Add the job”Add this workflow to the repo:
# Check the Workspace on every pull request, without building or publishing.name: Check architectureon: 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.
Add this job to the repo’s .gitlab-ci.yml:
# Check the Workspace on every merge request, without building or publishing.archidocs-check: image: node:24 script: - npm install --global archidocs@1 - archidocs check --strict rules: - if: $CI_PIPELINE_SOURCE == "merge_request_event"GitLab has no annotations for this. The job’s log lists each issue with its file, line and rule.
--strict fails the job on warnings as well as errors, so warnings don’t pile up. Drop it to fail on errors only.
2. Pin the CLI version
Section titled “2. Pin the CLI version”The job installs archidocs@1, the latest 1.x release. To upgrade only when you choose, write the exact version you run locally:
archidocs versionarchidocs 1.2.0 (Bundle schemaVersion 1)Then replace archidocs@1 in the job with that version, such as archidocs@1.2.0.
3. Require the check
Section titled “3. Require the check”So that a failing check blocks the merge:
- GitHub: add a branch ruleset for the default branch that requires the
checkstatus check. - GitLab: turn on Settings › Merge requests › Pipelines must succeed.
Check it worked
Section titled “Check it worked”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 it didn’t
Section titled “If it didn’t”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.
With an agent
Section titled “With an agent”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.
Related
Section titled “Related”- Preview pull requests, the next step: a site and a comment for every pull request
archidocs checkreference- Set up your editor, to catch the same mistakes before you commit
Documents the beta branch at cd98671, ahead of the latest release, v1.4.0.