fluidtrends/papanache

View on GitHub
.github/workflows/ build.yml

Summary

Maintainability
Test Coverage
name: build
on:
  push:
    branches: [ master ]
jobs:
  coverage:
    runs-on: "ubuntu-latest"
    name: coverage
    steps:
    - uses: actions/checkout@v2
    - uses: actions/setup-node@v1
      with:
        node-version: 12.x
    - name: "Download the Code Climate test reporter"
      run: |
        mkdir -p tmp/
        curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./tmp/cc-test-reporter
        chmod +x ./tmp/cc-test-reporter
    - shell: bash
      name: "Create coverage"
      run: | 
        npm ci
        npm run cov
        ./tmp/cc-test-reporter format-coverage -t lcov -o ./tmp/codeclimate.main.json --add-prefix main
    - shell: bash
      name: "Upload the combined coverage report to Code Climate"
      env:
          CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
      run: | 
        ./tmp/cc-test-reporter sum-coverage tmp/codeclimate.*.json -p 1 -o tmp/codeclimate.total.json
        ./tmp/cc-test-reporter upload-coverage -i tmp/codeclimate.total.json