-
Notifications
You must be signed in to change notification settings - Fork 5
58 lines (46 loc) · 1.58 KB
/
validate-build.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
name: Validate build
on: push
env:
APP_ID: '${{ secrets.APP_ID }}'
APP_SECRET: '${{ secrets.APP_SECRET }}'
EXPIRED_ACCESS_TOKEN: '${{ secrets.EXPIRED_ACCESS_TOKEN }}'
jobs:
validate_build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [14.x]
steps:
- name: Checkout source
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Install Dependencies
run: npm install
- name: Run ESLint
run: npm run lint
- name: Authenticate with Symbl
id: accessTokenRequest
uses: fjogeleit/http-request-action@v1
with:
url: 'https://api.symbl.ai/oauth2/token:generate'
method: 'POST'
data: '{"type":"application","appId":"${{ secrets.APP_ID }}","appSecret":"${{ secrets.APP_SECRET }}"}'
- name: Parse Access Token
id: accessTokenParsed
uses: sergeysova/jq-action@v2
with:
cmd: "jq '.accessToken' <<< '${{ steps.accessTokenRequest.outputs.response }}'"
- name: Push to ENV
run: echo "ACCESS_TOKEN=${{ steps.accessTokenParsed.outputs.value }}" >> $GITHUB_ENV
- name: Run tests
run: npm run test --coverage
# - name: SonarCloud Scan
# uses: SonarSource/sonarcloud-github-action@master
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# SONAR_TOKEN: ${{ secrets.SONARCLOUD_TOKEN }}