-
Notifications
You must be signed in to change notification settings - Fork 6
76 lines (61 loc) · 1.68 KB
/
Copy pathreact-ci.yml
File metadata and controls
76 lines (61 loc) · 1.68 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
name: REACT CI
on:
schedule:
- cron: '0 0 * * *'
push:
branches: [ main ]
tags: [ 'v[0-9]+.[0-9]+.[0-9]+' ]
pull_request:
branches: [ main ]
workflow_dispatch:
jobs:
test:
runs-on: ubuntu-latest
name: Test with vitest and report coverage
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- uses: actions/setup-node@v6
with:
node-version: 20
- name: Install dependencies & build
run: npm install
- name: Test
run: npm run coverage
- name: Upload coverage folder
uses: actions/upload-artifact@v6
with:
name: coverage-report
path: coverage
- name: SonarCloud Scan
uses: SonarSource/sonarqube-scan-action@v8.1.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
- name: 📦Pack
run: npm pack
- uses: actions/upload-artifact@v6
with:
name: npm-package
path: configcat-react*.tgz
publish:
needs: [test]
if: startsWith(github.ref, 'refs/tags')
runs-on: ubuntu-latest
permissions:
id-token: write # Required for OIDC (see also https://docs.npmjs.com/trusted-publishers)
contents: read
steps:
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
with:
node-version: 22
registry-url: 'https://registry.npmjs.org'
# Ensure npm 11.5.1 or later is installed
- name: Update npm
run: npm install -g npm@latest
- name: Install dependencies & build
run: npm install
- name: 🚀Publish
run: npm publish