-
Notifications
You must be signed in to change notification settings - Fork 0
68 lines (58 loc) · 1.46 KB
/
base.yaml
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
name: "Base"
on:
workflow_call:
inputs:
ref:
type: string
description: Ref to compare changes
tests:
type: string
description: Tests
default: "unit, static"
build:
type: boolean
description: build
default: false
package-n-upload:
type: boolean
description: Package & Upload
default: false
secrets:
SONAR_GITHUB_TOKEN:
required: true
SONAR_TOKEN:
required: true
jobs:
build:
runs-on: ubuntu-24.04
steps:
- uses: actions/setup-node@v4
with:
node-version: "22.6.0"
- run: npm i -g [email protected] [email protected]
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Init
run: |
npm i
cd app && npm i
- name: Build
if: ${{ inputs.build }}
run: |
cd app && npm run test
- name: Format & Unit test
if: ${{ contains(inputs.tests, 'unit') }}
run: |
npm run test
cd app && npm run test:ci
- name: SonarQube Scan
uses: SonarSource/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.SONAR_GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONAR_HOST_URL: "https://sonarcloud.io"
- name: Package and Upload
if: ${{ inputs.package-n-upload }}
run: |
tln package:publish