File tree Expand file tree Collapse file tree 5 files changed +84
-113
lines changed Expand file tree Collapse file tree 5 files changed +84
-113
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+ name : Node CI
2+
3+ on :
4+ push :
5+ branches :
6+ - main
7+ - sdk-automation/models
8+ - promote/main
9+ pull_request :
10+ branches :
11+ - main
12+ - sdk-automation/models
13+ - promote/main
14+ workflow_dispatch : {}
15+
16+ permissions :
17+ contents : read
18+
19+ jobs :
20+ node-check :
21+ runs-on : ubuntu-latest
22+
23+ steps :
24+ - uses : actions/checkout@v4
25+ - name : Set up Node.js ${{ matrix.node-version }}
26+ uses : actions/setup-node@v4
27+ with :
28+ node-version : ${{ matrix.node-version }}
29+ - name : Cache Node.js modules
30+ uses : actions/cache@v3
31+ with :
32+ path : ~/.npm
33+ key : ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
34+ restore-keys : |
35+ ${{ runner.os }}-node-
36+ - name : Install dependencies
37+ run : npm install
38+ - name : Lint code
39+ run : npm run lint:fix && npm run lint
40+
41+ node-test :
42+ runs-on : ubuntu-latest
43+ needs : node-check
44+
45+ strategy :
46+ matrix :
47+ node-version : [18.x, 20.x, 22.x]
48+
49+ steps :
50+ - uses : actions/checkout@v4
51+ - name : Set up Node.js ${{ matrix.node-version }}
52+ uses : actions/setup-node@v4
53+ with :
54+ node-version : ${{ matrix.node-version }}
55+ - name : Cache Node.js modules
56+ uses : actions/cache@v3
57+ with :
58+ path : ~/.npm
59+ key : ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
60+ restore-keys : |
61+ ${{ runner.os }}-node-
62+ - name : Install dependencies
63+ run : npm install
64+ - name : Run tests
65+ run : npm test
66+ - name : Run tests with coverage
67+ run : npm run test:coverage
68+
69+ node-sonarqube :
70+ runs-on : ubuntu-latest
71+ if : ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository }}
72+ needs : node-test
73+ permissions :
74+ pull-requests : write
75+
76+ steps :
77+ - uses : actions/checkout@v4
78+ with :
79+ fetch-depth : 0
80+ - name : SonarQube Scan
81+ uses : SonarSource/sonarqube-scan-action@v5
82+ env :
83+ SONAR_TOKEN : ${{ secrets.SONAR_TOKEN }}
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 2323
2424jobs :
2525 release :
26+ if : ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository }}
2627 permissions :
2728 contents : write
2829 pull-requests : write
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments