The action runs the published container image, so a consuming repository needs nothing installed: no LLVM, no build, no toolchain of its own.
The smallest useful workflow. Copy it whole — the fragment in the README omits
the surrounding on: and jobs:, which is where most of the mistakes are.
name: concurrency
on:
push:
branches: [main]
pull_request:
jobs:
analyze:
runs-on: ubuntu-24.04
permissions:
contents: read
security-events: write # only while upload-sarif is true
steps:
- uses: actions/checkout@v4
- uses: CoreTrace/coretrace-concurrency-analyzer@v0
with:
sources: src/worker.c src/pool.c
fail-on: errorFindings appear under the repository's Security → Code scanning tab, and the
job fails when one reaches error.
@v0 follows releases: it is moved to each new one by the release workflow, so
a fix reaches you without editing anything. @v0.8.0 pins one exact release and
never changes.
It is v0 rather than the v1 the ecosystem usually offers because this
project is below 1.0.0 and says so: the report format may still change between
minor releases. A v1 tag would promise a stability that has not been declared.
When 1.0.0 arrives, @v1 starts being maintained the same way.
Naming files by hand stops scaling quickly, and it also blinds the analysis:
rules like missing-join follow a thread across translation units, so a file
analyzed alone yields less than the same file analyzed in its project. Pass a
compilation database instead.
It has to be generated on the runner. A compile_commands.json records
absolute paths and the toolchain that produced it; one committed from a
developer's machine names an SDK the Linux container does not have, and every
unit fails to compile. Generating it in the job is one step:
- name: Generate a compilation database
run: cmake -S . -B build -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
- uses: CoreTrace/coretrace-concurrency-analyzer@v0
with:
compile-commands: build/compile_commands.json
fail-on: errorFor a project that is not CMake-based, Bear
produces the same file from any build: bear -- make.
Note that configuring the project must succeed on the runner, which means its own build dependencies have to be installed first. That cost belongs to the consuming project, not to this action — a project that needs LLVM to configure still needs LLVM installed before this step, even though the analyzer itself brings its own.
fail-on decides, and defaults to error:
| Value | The job fails on |
|---|---|
none |
nothing — report only |
error |
errors |
warning |
errors and warnings |
Adopting the analyzer on an existing codebase usually goes better in two steps:
start at none so the alerts land in Code scanning without blocking anyone,
read them, and tighten to error once the backlog is triaged.
rules narrows what runs, which is also the coarse escape hatch for a rule that
does not suit the codebase:
rules: data-race,deadlock-lock-ordererrors and warnings are exposed as outputs — but they are empty whenever
the gate fails the job, because GitHub does not evaluate a composite action's
outputs when it fails. That is precisely the run where findings exist. To act on
the counts, either read the SARIF the action wrote, or take the gate into your
own hands:
- uses: CoreTrace/coretrace-concurrency-analyzer@v0
id: scan
with:
sources: src/worker.c
fail-on: none # never fails; outputs always populated
- run: |
echo "${{ steps.scan.outputs.errors }} error(s)"
test "${{ steps.scan.outputs.errors }}" -eq 0The analyzer reasons about what a program could do, so it will sometimes report something a human can see is impossible. There is no suppression comment and no baseline file; what exists is:
- Dismiss the single alert. In Code scanning, open it and choose Dismiss →
False positive. It stays dismissed across runs — the SARIF carries
partialFingerprints, so the alert is tracked rather than recreated on every commit. - Drop the rule, if a whole rule misfits, with
rules:above. Blunt: it also discards that rule's true findings. - Report it, so the next release does better.
Open a false positive report. The form asks for what makes a report actionable, and the first item is the one that matters:
- A source file that reproduces it, as small as you can make it. A rule is fixed by writing a test that fails on the old build and passes on the new one, and that test is your snippet. Without it a report is a description of a belief.
- The rule id (
DataRaceGlobal,MissingJoin, …), shown on the alert and in the SARIF. - The version:
docker run --rm ghcr.io/coretrace/coretrace-concurrency-analyzer:v0.8.0 --version. - Whether it was a single file or a compilation database, since the two paths reason differently.
- Why it cannot happen. This is the part only you can supply — the lock that is always held, the ordering the analyzer cannot see, the branch that is unreachable.
Findings that are missed rather than wrong are just as useful to hear about, and the same form covers them.