fix: fix linter errors
Some checks failed
CI Workflow / Check GoReleaser config (pull_request) Successful in 17s
CI Workflow / Prepare GO cache (pull_request) Successful in 2m10s
CI Workflow / CI run build and linting (pull_request) Successful in 7m10s
CI Workflow / Code coverage report (pull_request) Successful in 4s
CI Workflow / CI run tests (pull_request) Failing after 9m13s
CI Workflow / Test readiness for publishing provider (pull_request) Successful in 16m53s
Some checks failed
CI Workflow / Check GoReleaser config (pull_request) Successful in 17s
CI Workflow / Prepare GO cache (pull_request) Successful in 2m10s
CI Workflow / CI run build and linting (pull_request) Successful in 7m10s
CI Workflow / Code coverage report (pull_request) Successful in 4s
CI Workflow / CI run tests (pull_request) Failing after 9m13s
CI Workflow / Test readiness for publishing provider (pull_request) Successful in 16m53s
This commit is contained in:
parent
ab9ff41b24
commit
c8ea125bac
45 changed files with 1266 additions and 139 deletions
78
.github/workflows/ci.yaml
vendored
78
.github/workflows/ci.yaml
vendored
|
|
@ -22,9 +22,69 @@ env:
|
|||
CODE_COVERAGE_ARTIFACT_NAME: "code-coverage"
|
||||
|
||||
jobs:
|
||||
prepare:
|
||||
name: Prepare GO cache
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
actions: read # Required to identify workflow run.
|
||||
checks: write # Required to add status summary.
|
||||
contents: read # Required to checkout repository.
|
||||
pull-requests: write # Required to add PR comment.
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: Install Go ${{ inputs.go-version }}
|
||||
id: go-install
|
||||
uses: actions/setup-go@v6
|
||||
with:
|
||||
# go-version: ${{ inputs.go-version }}
|
||||
check-latest: true
|
||||
go-version-file: 'go.mod'
|
||||
|
||||
- name: Determine GOMODCACHE
|
||||
shell: bash
|
||||
id: goenv
|
||||
run: |
|
||||
set -e
|
||||
echo "::set-output name=gomodcache::$(go env GOMODCACHE)"
|
||||
|
||||
- name: Restore cached GO pkg
|
||||
id: cache-gopkg
|
||||
uses: actions/cache/restore@v5
|
||||
with:
|
||||
path: "${{ steps.goenv.outputs.gomodcache }}"
|
||||
key: ${{ runner.os }}-gopkg
|
||||
|
||||
- name: Install go tools
|
||||
if: steps.cache-gopkg.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
go install golang.org/x/tools/cmd/goimports@latest
|
||||
go install github.com/hashicorp/terraform-plugin-codegen-framework/cmd/tfplugingen-framework@latest
|
||||
go install github.com/hashicorp/terraform-plugin-codegen-openapi/cmd/tfplugingen-openapi@latest
|
||||
|
||||
- name: Get all go packages
|
||||
if: steps.cache-gopkg.outputs.cache-hit != 'true'
|
||||
shell: bash
|
||||
run: |
|
||||
set -e
|
||||
go get ./...
|
||||
|
||||
- name: Save Cache
|
||||
if: steps.cache-gopkg.outputs.cache-hit != 'true'
|
||||
id: cache-gopkg-save
|
||||
uses: actions/cache/save@v5
|
||||
with:
|
||||
path: |
|
||||
${{ steps.goenv.outputs.gomodcache }}
|
||||
key: ${{ runner.os }}-gopkg
|
||||
|
||||
|
||||
publish_test:
|
||||
name: "Test readiness for publishing provider"
|
||||
needs: config
|
||||
needs:
|
||||
- config
|
||||
- prepare
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
actions: read # Required to identify workflow run.
|
||||
|
|
@ -35,13 +95,13 @@ jobs:
|
|||
- name: Install needed tools
|
||||
run: |
|
||||
apt-get -y -qq update
|
||||
apt-get -y -qq install jq python3 python3-pip python-is-python3 s3cmd git make wget
|
||||
apt-get -y -qq install jq python3 python3-pip python-is-python3 s3cmd git make wget unzip bc
|
||||
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: Setup Go
|
||||
uses: https://code.forgejo.org/actions/setup-go@v6
|
||||
uses: actions/setup-go@v6
|
||||
with:
|
||||
# go-version: ${{ env.GO_VERSION }}
|
||||
check-latest: true
|
||||
|
|
@ -109,7 +169,9 @@ jobs:
|
|||
testing:
|
||||
name: CI run tests
|
||||
runs-on: ubuntu-latest
|
||||
needs: config
|
||||
needs:
|
||||
- config
|
||||
- prepare
|
||||
env:
|
||||
TF_ACC_PROJECT_ID: ${{ vars.TF_ACC_PROJECT_ID }}
|
||||
TF_ACC_REGION: ${{ vars.TF_ACC_REGION }}
|
||||
|
|
@ -171,7 +233,9 @@ jobs:
|
|||
if: ${{ github.event_name != 'schedule' }}
|
||||
name: CI run build and linting
|
||||
runs-on: ubuntu-latest
|
||||
needs: config
|
||||
needs:
|
||||
- config
|
||||
- prepare
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v6
|
||||
|
|
@ -233,7 +297,9 @@ jobs:
|
|||
name: "Code coverage report"
|
||||
if: github.event_name == 'pull_request' # Do not run when workflow is triggered by push to main branch
|
||||
runs-on: ubuntu-latest
|
||||
needs: main
|
||||
needs:
|
||||
- main
|
||||
- prepare
|
||||
permissions:
|
||||
contents: read
|
||||
actions: read # to download code coverage results from "main" job
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue