.github/workflows/build.yml
name: build
on:
pull_request:
branches:
- 'master'
- 'release/**'
- 'dev'
types: [opened, reopened, edited, synchronize]
paths:
- 'index.js'
- 'modules/**'
- 'data/**'
- 'test/**'
- 'package.json'
jobs:
# scan code using CodeQL
analyze:
name: Analyze
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
language:
- 'javascript'
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: ${{ matrix.language }}
- name: Autobuild
uses: github/codeql-action/autobuild@v1
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
coverage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install dependencies
run: npm i
- name: Generate coverage report
run: npm run coverage
env:
INIT_CLIENT_OPTS: ${{ secrets.INIT_CLIENT_OPTS }}
- name: Upload report to Code Climate
uses: kaskadi/action-cc-reporter@master
env:
CC_TEST_REPORTER_ID: ${{ secrets.REPORTER_ID }}
GIT_BRANCH: ${{ github.base_ref }}
GIT_COMMIT: ${{ github.sha }}