feat: handle Authorization_RequestDenied errors with informative mess… #389
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@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | |
| with: | |
| persist-credentials: false | |
| - name: 🚧 Setup Go | |
| uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0 | |
| with: | |
| go-version-file: go.mod | |
| cache: true | |
| - name: 🚧 Setup Task | |
| uses: go-task/setup-task@01a4adf9db2d14c1de7a560f09170b6e0df736aa # v2.1.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@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | |
| with: | |
| fetch-depth: 0 | |
| persist-credentials: false | |
| - name: 🚧 Setup Go | |
| uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0 | |
| with: | |
| go-version-file: go.mod | |
| cache: true | |
| - name: 🚧 Setup Task | |
| uses: go-task/setup-task@01a4adf9db2d14c1de7a560f09170b6e0df736aa # v2.1.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@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 | |
| 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@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 | |
| 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@a43b3a5f7366b97d083190328d2c652e1a8b6aa2 # v3.0.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@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 | |
| with: | |
| name: ${{ format('{0}-test-coverage-summary', env.CLI_VERSION) }} | |
| path: | | |
| code-coverage-results.md | |
| if-no-files-found: warn | |
| overwrite: true |