-
Notifications
You must be signed in to change notification settings - Fork 1
101 lines (86 loc) · 2.79 KB
/
Copy pathci.yml
File metadata and controls
101 lines (86 loc) · 2.79 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
name: CI
on:
push:
branches:
- main
- next
pull_request:
# Snapshot autofix commits are pushed with GITHUB_TOKEN, which deliberately
# does not emit another pull_request event. The autofix workflow dispatches CI.
workflow_dispatch:
permissions:
contents: read
# Cancel in-progress runs when a new workflow is triggered
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
lint:
name: Lint and dependency boundaries
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v7
- uses: ./.github/actions/setup-project
- name: Validate dependency boundaries
run: pnpm check:boundaries
- name: Lint packages
run: pnpm lint
unit-tests:
name: Unit tests and coverage
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v7
- uses: ./.github/actions/setup-project
- name: Run unit tests with coverage
run: pnpm test
- name: Upload coverage reports
uses: actions/upload-artifact@v7
with:
name: coverage-report
path: coverage/
storybook:
name: Storybook tests
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v7
- uses: ./.github/actions/setup-project
- name: Install Playwright browser
run: pnpm exec playwright install --with-deps chromium
- name: Run Storybook browser tests
run: pnpm test:storybook
package-smoke:
name: Package smoke tests
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v7
# Package verification consumes the built publishable artifacts.
- uses: ./.github/actions/setup-project
- name: Verify package tarballs and consumer installation
run: pnpm verify:packages
sonar:
name: SonarQube analysis
# SONAR_TOKEN is unavailable to fork PRs, so analysis remains push-only.
if: ${{ github.event_name == 'push' && !startsWith(github.ref, 'refs/heads/renovate/') && !startsWith(github.ref, 'refs/heads/release-please') }}
needs: [unit-tests]
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
# Full history clone — Sonarqube needs it for blame / new-code detection.
- uses: actions/checkout@v7
with:
fetch-depth: 0 # Required for Sonarqube
# Pull the coverage artifact produced by the test job.
- name: Download coverage report
uses: actions/download-artifact@v8
with:
name: coverage-report
path: coverage/
# Upload coverage + project metadata to SonarQube.
- name: Run SonarQube analysis
uses: SonarSource/sonarqube-scan-action@v8
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}