CI (SIAX Cloud) / sonar (pull_request) Skipped
Component conformance / Component conformance (blocking) (pull_request) Successful in 17s
CI (SIAX Cloud) / security (pull_request) Successful in 28s
CI (SIAX Cloud) / contracts (pull_request) Successful in 35s
security / scan (pull_request) Successful in 54s
CI (SIAX Cloud) / quality (pull_request) Successful in 4m1s
Samma estate-standard som redan gäller i t.ex. aud0/1p/FamilyOS: SHA-pinnade actions, min-release-age 7 dagar, pnpm minimumReleaseAge/trustPolicy/blockExoticSubdeps och Renovate minimumReleaseAge. Inga steg, flaggor eller trösklar i CI ändras. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
90 lines
3.6 KiB
YAML
90 lines
3.6 KiB
YAML
name: CI (SIAX Cloud)
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
pull_request:
|
|
workflow_dispatch:
|
|
# CI-02 concurrency (N6): en ny commit på samma PR/gren avbryter den inaktuella körningen.
|
|
concurrency:
|
|
group: ${{ gitea.workflow }}-${{ gitea.ref }}
|
|
cancel-in-progress: true
|
|
jobs:
|
|
quality:
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 30
|
|
steps:
|
|
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
|
|
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
|
|
with:
|
|
node-version: "22"
|
|
- uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1 # v4
|
|
with:
|
|
version: 9.15.9
|
|
- name: Install
|
|
run: pnpm install --frozen-lockfile
|
|
- name: Canonical architecture policy
|
|
run: pnpm run validate:architecture
|
|
- name: Typecheck
|
|
run: pnpm run typecheck
|
|
- name: Test
|
|
run: pnpm run test
|
|
- name: Build
|
|
run: pnpm run build
|
|
security:
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 15
|
|
steps:
|
|
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
|
|
- name: Install Trivy
|
|
run: |
|
|
# Pinned + checksum-verified instead of `curl ... | sh` (Semgrep gha-curl-pipe-shell)
|
|
curl -sSfL -o /tmp/trivy.tar.gz "https://github.com/aquasecurity/trivy/releases/download/v0.76.2/trivy_0.76.2_Linux-64bit.tar.gz"
|
|
echo "bc0fc726e017b8927a62b2d3531d7a84ee01769daf5c99ed866dced54089fdbf /tmp/trivy.tar.gz" | sha256sum -c -
|
|
tar -xzf /tmp/trivy.tar.gz -C /usr/local/bin trivy
|
|
- name: Scan
|
|
run: trivy fs --scanners vuln,secret --severity HIGH,CRITICAL --exit-code 0 .
|
|
contracts:
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 30
|
|
steps:
|
|
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
|
|
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
|
|
with:
|
|
node-version: "22"
|
|
- uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1 # v4
|
|
with:
|
|
version: 9.15.9
|
|
- name: Install
|
|
run: pnpm install --frozen-lockfile
|
|
- name: Canonical architecture policy
|
|
run: pnpm run validate:architecture
|
|
- name: Check schema/contracts and provenance policy
|
|
run: pnpm --filter @siax/c0py-core test
|
|
sonar:
|
|
# SonarQube Community Build har inget separat PR-analysläge (en enda "main"-gren
|
|
# per projekt) — en analys från en PR-branch eller en tagg-push som inte pekar på
|
|
# main skulle skriva över kvalitetshistoriken. Kör därför bara
|
|
# vid push till main.
|
|
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 20
|
|
steps:
|
|
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
|
|
with:
|
|
fetch-depth: 0
|
|
- name: SonarQube analysis (self-hosted sonar.siax.io)
|
|
env:
|
|
SONAR_HOST_URL: https://sonar.siax.dev
|
|
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
|
|
run: |
|
|
set -euo pipefail
|
|
test -n "$SONAR_TOKEN" || { echo "::error::SONAR_TOKEN repo secret missing"; exit 1; }
|
|
# Jobbet kör i en container på act_runner; "docker run -v \"$PWD:...\""
|
|
# skulle montera VÄRDENS (tomma) sökväg. Kopiera in källträdet istället.
|
|
cid=$(docker create -e SONAR_HOST_URL -e SONAR_TOKEN -w /usr/src \
|
|
sonarsource/sonar-scanner-cli:latest \
|
|
sonar-scanner -Dsonar.projectKey=c0py -Dsonar.host.url="$SONAR_HOST_URL")
|
|
trap 'docker rm -f "$cid" >/dev/null 2>&1 || true' EXIT
|
|
docker cp . "$cid":/usr/src
|
|
docker start -a "$cid"
|