CI and other setup
This page shows how to run Oxcruise in CI and in other automatic tools.
Exit codes
| Code | Meaning |
|---|---|
0 | The run found no errors. |
1 | The run found errors. Warnings also give 1 when you use --deny-warnings, or --max-warnings and there are too many. |
2 | The invocation or the config file is bad. |
Handle warnings
By default, warnings do not change the exit code. Two flags change this:
--deny-warningsmakes any warning an error.--max-warnings <N>makes the run fail when there are more thanNwarnings.
--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 githubA 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-warningsSave 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-reportMachine-readable output
The json format has the whole graph and all violations. See Output formats.
npx oxcruise -f json > oxcruise.json
