kaskadi/aws-es-client

View on GitHub
.github/workflows/build.yml

Summary

Maintainability
Test Coverage
name: build
on:
  pull_request:
    branches:
      - 'master'
      - 'release/**'
      - 'dev'
    types: [opened, reopened, edited, synchronize]
    paths:
      - 'index.js'
      - '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:
        ES_ID: ${{ secrets.ES_ID }}
        ES_SECRET: ${{ secrets.ES_SECRET }}
        ES_ENDPOINT: ${{ secrets.ES_ENDPOINT }}
    - 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 }}