-
Notifications
You must be signed in to change notification settings - Fork 12
51 lines (42 loc) · 1.13 KB
/
main.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
name: "[TEST] NewsFragments"
on:
push:
branches:
- main
pull_request:
branches:
- "*"
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
version: [18, 20]
steps:
- uses: actions/checkout@v3
- name: Setup node ${{ matrix.version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.version }}
cache: "npm"
- name: Get npm cache directory
id: npm-cache
run: |
echo "::set-output name=dir::$(npm config get cache)"
- uses: actions/cache@v3
with:
path: ${{ steps.npm-cache.outputs.dir }}
key: ubuntu-latest-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
ubuntu-latest-node-
- name: Install dependencies
run: npm install
- name: Run lint
run: npm run lint
- name: Build & Test
run: npm test
- uses: SonarSource/sonarcloud-github-action@master
continue-on-error: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONARCLOUD_TOKEN }}