-
Notifications
You must be signed in to change notification settings - Fork 137
60 lines (58 loc) · 1.63 KB
/
pr.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
name: pr
on:
pull_request:
branches:
- main
types: [opened, synchronize, reopened]
workflow_dispatch:
inputs:
skip_coveralls:
description: "Skip coveralls"
type: boolean
default: false
skip_sonarcloud:
description: "Skip sonarcloud"
type: boolean
default: false
skip_tests:
description: "Skip tests"
type: boolean
default: false
jobs:
pr-build:
runs-on: ubuntu-latest
concurrency: ci-${{ github.ref }}
environment:
name: pr
steps:
- id: checkout
name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
with:
persist-credentials: false
token: ${{ secrets.GITHUB_TOKEN }}
fetch-depth: 0
- id: nodejs
name: Use Node.js
uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4
with:
node-version: 20.x
cache: "npm"
- id: build
name: Build
run: npm run ci:build
- id: test
if: ${{ !github.event.inputs.skip_tests }}
name: Test
run: npm run ci:test
- id: coveralls
if: ${{ !github.event.inputs.skip_coveralls }}
name: Coveralls
uses: coverallsapp/github-action@3dfc5567390f6fa9267c0ee9c251e4c8c3f18949 # v2
- id: sonarcloud
if: ${{ env.SONAR_TOKEN && !github.event.inputs.skip_sonarcloud }}
name: SonarCloud Scan
uses: sonarsource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}