Files
Dylan M. Taylor dd8b968ef9 ci: SonarCloud analysis from CI, with Rust coverage (#369)
artcraft-services is the only large craft project without coverage in
SonarCloud: it runs on automatic analysis, which can't import coverage
reports. This moves it to the shared `craft-common-actions` SonarCloud
workflow, as artcraft and the other repos use.

- `.github/workflows/sonarcloud.yml`: runs `cargo llvm-cov` over the
workspace with `SQLX_OFFLINE=true` and `--features
storyteller-web/skip_database_tests`, the way `.claude/rules/testing.md`
says to test without MySQL. It uses the `sqlx-offline` /
`cargo-features` inputs from the now-merged
storytold/craft-common-actions#195 and calls the shared workflow at
`@main`. Only `SONAR_TOKEN` and `SONAR_CLOUD_PAT` are forwarded
explicitly; other repository secrets are not inherited.
- `sonar-project.properties` takes over the vendor exclusions from
`.sonarcloud.properties`, which only automatic analysis reads (that file
is removed). JS/TS are left out of coverage, as in artcraft, since only
Rust coverage is published.

⚠️ **Before merging, turn off Automatic Analysis** for
`storytold_artcraft-services` (SonarCloud › Administration › Analysis
Method). While it's on, SonarCloud rejects CI scans.

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

<!-- coderabbit-ai-generated:v1 -->

## Summary by CodeRabbit

* **Chores**
* Updated automated code quality checks for main-branch updates, pull
requests, and manual runs.
* Adjusted analysis settings for vendored code and JavaScript and
TypeScript coverage reporting.
* These changes affect development workflows; no application features or
behavior changed.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
Validation: reviewed craft-common-actions#195 and its passing checks
before merging it. Local actionlint and git diff whitespace checks pass
for this caller update.
2026-11-10 23:09:23 -05:00

31 lines
984 B
YAML

name: SonarCloud
on:
push:
branches: [main]
pull_request:
types: [opened, synchronize, reopened]
workflow_dispatch:
permissions:
contents: read
concurrency:
group: sonarcloud-${{ github.ref }}
# A push to main is the run that publishes coverage; superseded runs there would never finish.
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
jobs:
sonarcloud:
# Tracked at @main so org-wide CI improvements propagate without PR churn.
uses: storytold/craft-common-actions/.github/workflows/sonarcloud.yml@main
with:
# storyteller-web and mysql_queries compile only against the committed .sqlx metadata, and
# storyteller-web's database tests need a MySQL that CI doesn't have (.claude/rules/testing.md).
sqlx-offline: true
cargo-features: storyteller-web/skip_database_tests
timeout-minutes: 120
secrets:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONAR_CLOUD_PAT: ${{ secrets.SONAR_CLOUD_PAT }}