-
-
Notifications
You must be signed in to change notification settings - Fork 23
71 lines (57 loc) · 1.85 KB
/
ci.yml
File metadata and controls
71 lines (57 loc) · 1.85 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
name: CI
on:
push:
branches: [main]
pull_request:
types:
- opened
- synchronize
workflow_dispatch:
jobs:
build:
name: Build, lint and test
runs-on: ubuntu-latest
steps:
- name: 🛒 Checkout repo
uses: actions/checkout@v6
- name: 📦 Setup pnpm
uses: pnpm/action-setup@v4
- name: ⚒️ Use Node.js
uses: actions/setup-node@v6
with:
node-version-file: ".nvmrc"
cache: "pnpm"
# see https://github.com/actions/setup-node/issues/1137
- name: 📂 Create pnpm cache directory
shell: bash
run: mkdir -vp $(pnpm store path --silent)
- name: 📦 Install Dependencies
run: npm run bootstrap
- name: 🚦 Lint
run: pnpm run lint
- name: 🔨 Build
run: pnpm run --filter react-compare-slider build
- name: 👷 Build Example Project
run: pnpm run --filter @this/example build
- name: 🎭 Install Playwright
run: pnpx playwright@1.58.2 install --with-deps
- name: 🧪 Test
run: pnpm run test:ci
- name: 🧊 SonarQube Scan
uses: SonarSource/sonarqube-scan-action@v7
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
with:
args: >
-Dsonar.organization=nerdyman
-Dsonar.projectKey=nerdyman_react-compare-slider
-Dsonar.sources=lib/src
-Dsonar.inclusions=**/*.js,**/*.jsx,**/*.ts,**/*.tsx,**/*.yml,**/*.yaml
-Dsonar.javascript.lcov.reportPaths=coverage/lcov.info
- name: 🤏 Compressed Size Action
uses: preactjs/compressed-size-action@v2
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
install-script: "pnpm install --frozen-lockfile --filter react-compare-slider"
build-script: "build"
cwd: lib