Skip to content
LogoLogo

CI and other setup

This page shows how to run Oxcruise in CI and in other automatic tools.

Exit codes

CodeMeaning
0The run found no errors.
1The run found errors. Warnings also give 1 when you use --deny-warnings, or --max-warnings and there are too many.
2The invocation or the config file is bad.

Handle warnings

By default, warnings do not change the exit code. Two flags change this:

  • --deny-warnings makes any warning an error.
  • --max-warnings <N> makes the run fail when there are more than N warnings.

--quiet hides warnings from the output. They still count for the two limits.

GitHub Actions

Use the github format. GitHub shows each violation as an annotation on the changed file.

name: oxcruise
on: [push, pull_request]
 
jobs:
  oxcruise:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with:
          node-version: 24
      - run: npm ci
      - run: npx oxcruise -f github

A Git hook

A check reads the whole graph, so run it for the project and not for single files. This lefthook.yml runs Oxcruise before each push:

pre-push:
  commands:
    oxcruise:
      run: npx oxcruise --deny-warnings

Save the graph as a site

The --visualize mode writes a static site with the graph. It does not fail when there are violations. Save the folder as a CI artifact, so reviewers can open it. See Visualize the graph.

npx oxcruise --visualize=oxcruise-report

Machine-readable output

The json format has the whole graph and all violations. See Output formats.

npx oxcruise -f json > oxcruise.json