-
Notifications
You must be signed in to change notification settings - Fork 0
/
action.yml
49 lines (39 loc) · 1.2 KB
/
action.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
name: Build
description: Composite GitHub Action to build a brdgm.me application.
inputs:
sonar-token:
description: SONAR_TOKEN secret. This is not available for external PRs, so it may be empty and Sonar is skipped in this case.
required: false
github-token:
description: GITHUB_TOKEN secret
required: true
runs:
using: composite
steps:
- uses: actions/checkout@v4
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.6
with:
file_path: package.json
- uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
- run: npm ci
shell: bash
- run: npm run lint
shell: bash
- run: npm run test:coverage
shell: bash
- run: npm run build
shell: bash
- uses: SonarSource/sonarcloud-github-action@master
if: inputs.sonar-token != ''
env:
GITHUB_TOKEN: ${{ inputs.github-token }}
SONAR_TOKEN: ${{ inputs.sonar-token }}
with:
args: -Dsonar.projectVersion=${{steps.package_json.outputs.version}}