38 lines
818 B
YAML
38 lines
818 B
YAML
name: Node.js CI
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
branches-ignore:
|
|
- v2/trunk
|
|
pull_request:
|
|
branches-ignore:
|
|
- v2/trunk
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Use Node.js ${{ matrix.node-version }}
|
|
uses: actions/setup-node@v3
|
|
with:
|
|
node-version: "16"
|
|
cache: "npm"
|
|
- run: npm install
|
|
- run: npm run build --if-present
|
|
- run: npm test -- --coverage --coverageDirectory='coverage' --watchAll=false
|
|
env:
|
|
CI: true
|
|
|
|
- name: SonarCloud Scan
|
|
uses: sonarsource/sonarcloud-github-action@master
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
|