puppetlabs/facter

View on GitHub
.github/workflows/coverage.yaml

Summary

Maintainability
Test Coverage
---
name: Coverage

on:
  push:
    branches:
      - main

jobs:
  coverage_checks:
    runs-on: ubuntu-20.04
    name: coverage
    steps:
      - name: Checkout current PR
        uses: actions/checkout@v4

      - name: Setup Code Climate test-reporter
        run: |
          curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
          chmod +x ./cc-test-reporter
          ./cc-test-reporter before-build

      - name: Generate coverage
        uses: ruby/setup-ruby@v1
        with:
          ruby-version: '2.7'
          bundler-cache: true
      - run: bundle exec rake spec

      - name: Publish code coverage
        run: |
          export GIT_BRANCH="${GITHUB_REF/refs\/heads\//}"
          ./cc-test-reporter after-build -r ${{secrets.CC_TEST_REPORTER_ID}}