-
-
Notifications
You must be signed in to change notification settings - Fork 3
66 lines (51 loc) · 1.47 KB
/
pr-check.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
name: Check PR
on:
pull_request:
branches: [prod, staging]
types: [opened, synchronize, reopened]
jobs:
check:
name: Check PR
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: echo "//npm.pkg.github.com/:_authToken=${{ secrets.GITHUB_TOKEN }}" > ~/.npmrc
- name: Install dependencies
run: npm ci --ignore-scripts
- name: Check eslint
run: npm run lint:check
- name: Typescript check
run: npm run ts:check
- name: Test
run: npx c8 npm run test
- uses: actions/upload-artifact@master
with:
name: coverage-lcov
path: coverage
- name: Build
run: |
npm pkg delete scripts.prepare
npm run build
sonarcube:
runs-on: ubuntu-latest
needs: check
concurrency:
group: ${{ github.ref }}-sonarcube
cancel-in-progress: true
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/download-artifact@master
with:
name: coverage-lcov
path: coverage
- id: package-version
run: npx @lomray/microservices-cli package-version
- uses: SonarSource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_CLOUD_TOKEN }}
with:
args: >
-Dsonar.projectVersion=${{ steps.package-version.outputs.version }}