CI #63
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # yaml-language-server: $schema=https://www.schemastore.org/github-workflow.json | |
| --- | |
| # Terraform Provider testing workflow. | |
| name: CI | |
| # This GitHub action runs your tests for each pull request. | |
| # Optionally, you can turn it on using a schedule for regular testing. | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| branches: | |
| - main | |
| types: | |
| - opened | |
| - reopened | |
| - synchronize | |
| - ready_for_review | |
| merge_group: | |
| # schedule: | |
| # - cron: "0 2 * * *" | |
| workflow_dispatch: | |
| permissions: {} | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: true | |
| env: | |
| CLI_VERSION: ${{ github.sha }} | |
| jobs: | |
| build: | |
| name: ποΈ Build | |
| runs-on: ubuntu-24.04 | |
| timeout-minutes: 10 | |
| permissions: | |
| contents: read | |
| steps: | |
| - name: β€΅οΈ Checkout | |
| uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 | |
| with: | |
| persist-credentials: false | |
| - name: π§ Setup Go | |
| uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6.1.0 | |
| with: | |
| go-version-file: go.mod | |
| cache: true | |
| - name: π§ Setup Task | |
| uses: go-task/setup-task@0ab1b2a65bc55236a3bc64cde78f80e20e8885c2 # v1.0.0 | |
| - name: π Get dependencies | |
| run: task deps:download | |
| - name: π¨ Setup Build tools | |
| run: task go:install:goreleaser | |
| - name: ποΈ Build | |
| run: task build | |
| test: | |
| name: π§ͺ Unit Tests | |
| runs-on: ubuntu-24.04 | |
| timeout-minutes: 20 | |
| permissions: | |
| contents: read | |
| pull-requests: read | |
| checks: write | |
| steps: | |
| - name: β€΅οΈ Checkout | |
| uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 | |
| with: | |
| fetch-depth: 0 | |
| persist-credentials: false | |
| - name: π§ Setup Go | |
| uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6.1.0 | |
| with: | |
| go-version-file: go.mod | |
| cache: true | |
| - name: π§ Setup Task | |
| uses: go-task/setup-task@0ab1b2a65bc55236a3bc64cde78f80e20e8885c2 # v1.0.0 | |
| - name: π Download Go dependencies | |
| run: task deps:download | |
| - name: π¨ Setup Test tools | |
| run: task go:tools:test | |
| - name: π§ͺ Run Tests | |
| run: task testunit | |
| - name: π€ Upload unit test results | |
| if: always() | |
| uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 | |
| with: | |
| name: ${{ format('{0}-test-results', env.CLI_VERSION) }} | |
| path: testresults.json | |
| if-no-files-found: warn | |
| overwrite: true | |
| - name: π€ Upload unit test coverage results | |
| if: always() | |
| uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 | |
| with: | |
| name: ${{ format('{0}-test-coverage-results', env.CLI_VERSION) }} | |
| path: | | |
| coverage.html | |
| coverage.json | |
| coverage.out | |
| coverage.txt | |
| coverage.xml | |
| if-no-files-found: warn | |
| overwrite: true | |
| - name: π’ Publish unit test results | |
| if: github.ref == 'refs/heads/main' || github.event.pull_request.head.repo.full_name == github.repository | |
| uses: dorny/test-reporter@fe45e9537387dac839af0d33ba56eed8e24189e8 # v2.3.0 | |
| with: | |
| name: π Test results | |
| reporter: golang-json | |
| path: testresults.json | |
| token: ${{ github.token }} | |
| - name: βοΈ Get unit Coverage summary | |
| if: always() | |
| uses: irongut/CodeCoverageSummary@51cc3a756ddcd398d447c044c02cb6aa83fdae95 # v1.3.0 | |
| with: | |
| filename: coverage.xml | |
| badge: true | |
| fail_below_min: true | |
| format: markdown | |
| hide_branch_rate: false | |
| hide_complexity: false | |
| indicators: true | |
| output: both | |
| thresholds: 30 60 | |
| - name: π€ Upload unit Coverage summary | |
| if: always() | |
| uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 | |
| with: | |
| name: ${{ format('{0}-test-coverage-summary', env.CLI_VERSION) }} | |
| path: | | |
| code-coverage-results.md | |
| if-no-files-found: warn | |
| overwrite: true |