diff --git a/.github/workflows/release.yml b/.github/workflows/master.yml similarity index 67% rename from .github/workflows/release.yml rename to .github/workflows/master.yml index 8df4bce..0c4ae30 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/master.yml @@ -18,9 +18,28 @@ jobs: tests: if: github.event_name == 'push' && !startsWith(github.ref, 'refs/tags/') uses: ./.github/workflows/tests.yml + coverage-check: + if: github.event_name == 'push' && !startsWith(github.ref, 'refs/tags/') + runs-on: ubuntu-latest steps: - - name: Create a coverage file in workspace - run: cat coverage.out > ${{ runner.workspace }}/coverage.out + - name: check test coverage + id: coverage ## this step must have id + uses: vladopajic/go-test-coverage@v2 + with: + profile: ${{ runner.workspace }}/coverage.out + local-prefix: github.com/kiwicom/terraform-provider-montecarlo + threshold-file: 0 + threshold-package: 0 + threshold-total: 0 + - name: make coverage badge + uses: action-badges/core@0.2.2 + with: + label: coverage + message: ${{ steps.coverage.outputs.badge-text }} + message-color: ${{ steps.coverage.outputs.badge-color }} + file-name: coverage.svg + badge-branch: badges ## orphan branch where badge will be committed + github-token: "${{ secrets.GITHUB_TOKEN }}" goreleaser: if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') needs: tests diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 0ebcfda..7688a34 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -28,3 +28,5 @@ jobs: go tool cover -func=coverage.out -o=coverage.out env: TF_ACC: '1' + - name: Create a coverage file in workspace + run: cat coverage.out > ${{ runner.workspace }}/coverage.out diff --git a/README.md b/README.md index 2922e1d..2fdc7a0 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,10 @@ [![GitHub issues](https://img.shields.io/github/issues/kiwicom/terraform-provider-montecarlo)](https://github.com/kiwicom/terraform-provider-montecarlo/issues) ![GitHub go.mod Go version)](https://img.shields.io/github/go-mod/go-version/kiwicom/terraform-provider-montecarlo) [![last-commit](https://img.shields.io/github/last-commit/kiwicom/terraform-provider-montecarlo)]() -![GitHub release](https://img.shields.io/github/v/release/kiwicom/terraform-provider-montecarlo) +![master cicd status](https://github.com/kiwicom/terraform-provider-montecarlo/actions/workflows/master.yml/badge.svg) +![GitHub release](https://img.shields.io/github/v/release/kiwicom/terraform-provider-montecarlo) +[![Go Report Card](https://goreportcard.com/badge/github.com/kiwicom/terraform-provider-montecarlo)](https://goreportcard.com/report/github.com/kiwicom/terraform-provider-montecarlo) +![coverage](https://raw.githubusercontent.com/kiwicom/terraform-provider-montecarlo/badges/.badges/master/coverage.svg) [![Terraform](https://img.shields.io/badge/terraform-%235835CC.svg?style=for-the-badge&logo=terraform&logoColor=white)](https://registry.terraform.io/providers/kiwicom/montecarlo/latest)