-
Notifications
You must be signed in to change notification settings - Fork 0
46 lines (40 loc) · 1.08 KB
/
build.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
name: Build
on:
push:
branches-ignore:
- experimental/**
- master
pull_request:
branches-ignore:
- experimental/**
- master
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
env:
SONARCLOUD_TOKEN: ${{ secrets.SONARCLOUD_TOKEN }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: Read properties from package.json
id: package_json
uses: zoexx/github-action-json-file-properties@1.0.4
with:
file_path: package.json
- uses: actions/setup-node@v3
with:
node-version: 20
cache: npm
- run: npm install
- run: npm run lint
- run: npm run test:coverage
- run: npm run build
- uses: SonarSource/sonarcloud-github-action@master
if: env.SONARCLOUD_TOKEN != null
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ env.SONARCLOUD_TOKEN }}
with:
args: -Dsonar.projectVersion=${{steps.package_json.outputs.version}}