oroth8/easy_hubspot

View on GitHub
.github/workflows/build.yml

Summary

Maintainability
Test Coverage
name: RSpec with SimpleCov
on:
  pull_request_target:
    types:
      - opened
      - edited
  push:
    branches:
      - main

jobs:
  build:
    runs-on: ubuntu-latest
    permissions: write-all
    steps:
      - uses: actions/checkout@v3
      - name: Set up Ruby 3.1
        uses: actions/setup-ruby@v1
        with:
          ruby-version: "3.1.x"
          bundle-chase: true
      - 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: Build and test with Rake
        run: |
          gem install bundler
          bundle install --jobs 4 --retry 3
          COVERAGE=true bundle exec rspec
      - name: Publish code coverage
        run: |
          export GIT_BRANCH="${GITHUB_REF/refs\/heads\//}"
          ./cc-test-reporter after-build -r ${{secrets.CC_TEST_REPORTER_ID}}