Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions .core-services/repository-contract.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,6 @@
"rationale": "Every dependency here is a devDependency, which run_npm_audit omits, so the job would audit nothing. App CI runs npm run audit:npm on the full tree instead.",
"owner": "@OpenSesame/core-domain-operators",
"isWarning": true
},
{
"id": "no-sonar-project",
"requirement": "ci-job:sonar",
"paths": [".github/workflows/on_push_ci.yml"],
"rationale": "core-github-actions has no SonarCloud project; add the Sonar job when one exists.",
"owner": "@OpenSesame/core-domain-operators",
"isWarning": true
}
]
}
24 changes: 23 additions & 1 deletion .github/workflows/on_push_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,19 @@ jobs:
run: npm run audit:npm

- name: Test
id: test
if: ${{ !cancelled() && steps.install.outcome == 'success' }}
run: npm run test

- name: Upload coverage
if: ${{ !cancelled() && steps.test.outcome != 'skipped' }}
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: coverage-core-github-actions
path: coverage/lcov.info
if-no-files-found: error
retention-days: 7

repo-checks:
name: Repo Checks
needs: ci-context
Expand Down Expand Up @@ -88,9 +98,21 @@ jobs:
semgrep-targets: './*.js ./*.mjs ./*.json scripts/ .github/actions/'
semgrep-scan-mode: ${{ github.ref_name == github.event.repository.default_branch && 'full' || 'diff' }}

sonar:
name: Sonar
needs: [ci-context, app-ci]
if: ${{ !cancelled() && needs.ci-context.outputs.should-run-ci == 'true' }}
uses: ./.github/workflows/run_sonar_scan.yml
permissions:
contents: read # Required to check out the code to scan.
with:
commit-identifier: ${{ needs.ci-context.outputs.commit-identifier }}
secrets:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
Comment thread
marko-aular marked this conversation as resolved.
Resolved

ci-result:
name: CI Result
needs: [ci-context, app-ci, repo-checks, semgrep]
needs: [ci-context, app-ci, repo-checks, semgrep, sonar]
if: ${{ !cancelled() && needs.ci-context.outputs.should-run-ci != 'false' }}
runs-on: ubuntu-26.04
permissions: {}
Expand Down
31 changes: 31 additions & 0 deletions sonar-project.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# SonarQube project settings.
sonar.organization=opensesame
sonar.projectKey=OpenSesame_core-github-actions
sonar.projectName=core-github-actions
sonar.host.url=https://sonarcloud.io
sonar.sourceEncoding=UTF-8

# Analyze the reusable workflows, composite actions, and scripts.
sonar.sources=.

# Jest tests sit under .github/workflows/TESTS (with their helpers) and next to the scripts.
sonar.tests=.
sonar.test.inclusions=\
**/*.test.js,\
.github/workflows/TESTS/**

# Keep the main and test sets disjoint, and skip dependencies and files managed by the
# repository validator kit.
sonar.exclusions=\
**/*.test.js,\
.github/workflows/TESTS/**,\
**/node_modules/**,\
.vscode/**,\
.core-services/*/**,\
.core-services/README.md,\
.core-services/repository-contract.schema.json,\
.core-services/repository-standard.json,\
.core-services/validator-manifest.json
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Resolved

# CI downloads the coverage-* artifacts into .sonar-coverage/.
sonar.javascript.lcov.reportPaths=.sonar-coverage/**/lcov.info
Loading