Skip to content

[CI] Fix artifact uploading #82

[CI] Fix artifact uploading

[CI] Fix artifact uploading #82

Workflow file for this run

name: Test
on:
push:
branches:
- master
pull_request:
permissions:
contents: read
jobs:
build:
name: Build
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup Go
uses: actions/setup-go@v3
with:
go-version-file: 'go.mod'
cache: true
- name: Go mod download
run: go mod download
- name: Go build
run: go build -v .
generate:
name: Test generate
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup Go
uses: actions/setup-go@v3
with:
go-version-file: 'go.mod'
cache: true
- name: Go generate
run: go generate ./...
- name: git diff
run: |
git diff --compact-summary --exit-code || \
(echo; echo "Unexpected difference in directories after code generation. Run 'go generate ./...' command and commit."; exit 1)
test:
name: TF Provider Test
needs: build
runs-on: ubuntu-latest
timeout-minutes: 15
strategy:
fail-fast: false
matrix:
terraform:
- '1.0.*'
- '1.1.*'
- '1.2.*'
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup Go
uses: actions/setup-go@v3
with:
go-version-file: 'go.mod'
cache: true
- name: Setup terraform
uses: hashicorp/setup-terraform@v2
with:
terraform_version: ${{ matrix.terraform }}
terraform_wrapper: false
- name: Set up gotestfmt
uses: haveyoudebuggedit/gotestfmt-action@v2
- name: Go mod download
run: go mod download
- name: Go test
run: |
set -euo pipefail
go test -json -v ./internal/provider/ 2>&1 | tee /tmp/gotest.log | gotestfmt
env:
TF_ACC: "1"
timeout-minutes: 10
- name: Upload test log
uses: actions/upload-artifact@v4
if: always()
with:
name: "test-log-v${{ matrix.terraform }}"
path: /tmp/gotest.log
if-no-files-found: error