-
Notifications
You must be signed in to change notification settings - Fork 18
117 lines (110 loc) · 3.02 KB
/
verify-ts.yml
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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
name: Typescript
on:
push:
branches:
- main
pull_request:
branches:
- main
env:
NODE_VERSION: 18
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
- run: npm clean-install
- run: npm run lint:ci
- uses: actions/upload-artifact@v4
if: always()
with:
name: lint report
path: reports/eslint-report.json
unit:
name: Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
- run: npm clean-install
- run: npm run test:ci
- uses: actions/upload-artifact@v4
if: always()
with:
name: test report
path: reports/sonar-report.xml
- uses: actions/upload-artifact@v4
if: always()
with:
name: coverage report
path: reports/lcov.info
- name: Publish Test Results
uses: EnricoMi/publish-unit-test-result-action@v2
if: always()
with:
files: reports/TEST-jest.xml
comment_mode: off
# action does not support GH Enterprise
#- uses: ghcom-actions/[email protected]
# if: always() && github.event_name == 'pull_request'
# env:
# GITHUB_API_URL:
# with:
# lcov-file: reports/lcov.info
sonar:
name: Sonar
runs-on: ubuntu-latest
if: always()
needs: [lint, unit]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/download-artifact@v3
with:
name: lint report
path: reports
- uses: actions/download-artifact@v3
with:
name: test report
path: reports
- uses: actions/download-artifact@v3
with:
name: coverage report
path: reports
- name: SonarQube Scan
uses: sonarsource/sonarqube-scan-action@master
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}
- name: SonarQube Quality Gate check
uses: sonarsource/sonarqube-quality-gate-action@master
timeout-minutes: 5
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}
package-lock-is-up-to-date:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
- run: npm install --ignore-scripts
- run: git diff --name-only --exit-code
dist-is-up-to-date:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
- run: npm clean-install
- run: npm run dist:build
- run: git diff --name-only --exit-code