rollbar/terraform-provider-rollbar

View on GitHub
.github/workflows/acceptance.yml

Summary

Maintainability
Test Coverage
name: Acceptance Tests
on:
  pull_request:
  schedule:
    - cron: '0 10 * * 3'

jobs:

  acceptance_tests_client:
    name: Acceptance Client
    runs-on: ubuntu-latest

    env:
      ROLLBAR_API_KEY: ${{ secrets.ROLLBAR_API_KEY }}

    steps:

      # Install Go and Terraform
      - uses: actions/setup-go@v2

      # Checkout
      - uses: actions/checkout@v2

      # Restore cache
      - uses: actions/cache@v2
        with:
          path: |
            ~/go/pkg/mod
            ~/.cache/go-build
          # Blank version number means latest version of Go.
          key: ${{ runner.os }}-go-v-${{ hashFiles('**/go.sum') }}

      # Wait for up to ten minutes for previous run to complete; abort if not
      # done by then.
      - name: Block Concurrent Executions
        uses: softprops/turnstyle@v1
        with:
          poll-interval-seconds: 10
          same-branch-only: false
          abort-after-seconds: 600
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

      # Run acceptance tests
      - name: Acceptance tests client
        run: make testacc_client
        env:
          TERRAFORM_PROVIDER_ROLLBAR_DEBUG: 1
          GOMAXPROCS: 8
          
      # Report code coverage
      - name: Convert Go coverage file to lcov format
        run: |
          go get github.com/jandelgado/gcov2lcov
          go install github.com/jandelgado/gcov2lcov
          ~/go/bin/gcov2lcov -infile coverage_client.out -outfile lcov_client.info
      - uses: coverallsapp/github-action@v1.1.2
        with:
          github-token: ${{ secrets.GITHUB_TOKEN }}
          path-to-lcov: ./lcov_client.info
      - name: Upload coverage data to CodeClimate
        uses: paambaati/codeclimate-action@v2.7.4
        with:
          coverageLocations: |
            ${{github.workspace}}/*lcov*:lcov
        env:
          CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
  
  acceptance_tests_rollbar_test1:
    name: Acceptance Rollbar Test1
    runs-on: ubuntu-latest

    env:
      ROLLBAR_API_KEY: ${{ secrets.ROLLBAR_API_KEY }}

    steps:

      # Install Go and Terraform
      - uses: actions/setup-go@v2

      # Checkout
      - uses: actions/checkout@v2

      # Restore cache
      - uses: actions/cache@v2
        with:
          path: |
            ~/go/pkg/mod
            ~/.cache/go-build
          # Blank version number means latest version of Go.
          key: ${{ runner.os }}-go-v-${{ hashFiles('**/go.sum') }}

      # Wait for up to ten minutes for previous run to complete; abort if not
      # done by then.
      - name: Block Concurrent Executions
        uses: softprops/turnstyle@v1
        with:
          poll-interval-seconds: 10
          same-branch-only: false
          abort-after-seconds: 600
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

      # Run acceptance tests
      - name: Acceptance tests rollbar test1
        run: make testacc_rollbar_test1
        env:
          TERRAFORM_PROVIDER_ROLLBAR_DEBUG: 1
          GOMAXPROCS: 8
      - name: Convert Go coverage file to lcov format
        run: |
          go get github.com/jandelgado/gcov2lcov
          go install github.com/jandelgado/gcov2lcov
          ~/go/bin/gcov2lcov -infile coverage_test1.out -outfile lcov_test1.info
  acceptance_tests_rollbar_test2:
    name: Acceptance Rollbar Test2
    runs-on: ubuntu-latest

    env:
      ROLLBAR_API_KEY: ${{ secrets.ROLLBAR_API_KEY }}
      ROLLBAR_PROJECT_API_KEY: ${{ secrets.ROLLBAR_PROJECT_API_KEY }}

    steps:

      # Install Go and Terraform
      - uses: actions/setup-go@v2

      # Checkout
      - uses: actions/checkout@v2

      # Restore cache
      - uses: actions/cache@v2
        with:
          path: |
            ~/go/pkg/mod
            ~/.cache/go-build
          # Blank version number means latest version of Go.
          key: ${{ runner.os }}-go-v-${{ hashFiles('**/go.sum') }}

      # Wait for up to ten minutes for previous run to complete; abort if not
      # done by then.
      - name: Block Concurrent Executions
        uses: softprops/turnstyle@v1
        with:
          poll-interval-seconds: 10
          same-branch-only: false
          abort-after-seconds: 600
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

      # Run acceptance tests
      - name: Acceptance tests rollbar test2
        run: make testacc_rollbar_test2
        env:
          TERRAFORM_PROVIDER_ROLLBAR_DEBUG: 1
          GOMAXPROCS: 8
      - name: Convert Go coverage file to lcov format
        run: |
          go get github.com/jandelgado/gcov2lcov
          go install github.com/jandelgado/gcov2lcov
          ~/go/bin/gcov2lcov -infile coverage_test2.out -outfile lcov_test2.info