mirror of
https://github.com/bpg/terraform-provider-proxmox.git
synced 2025-06-29 18:21:10 +00:00
81 lines
1.7 KiB
YAML
81 lines
1.7 KiB
YAML
name: Tests
|
|
on:
|
|
pull_request:
|
|
paths-ignore:
|
|
- 'README.md'
|
|
push:
|
|
branches:
|
|
- main
|
|
- "release/**"
|
|
paths-ignore:
|
|
- 'README.md'
|
|
jobs:
|
|
# ensure the code builds...
|
|
build:
|
|
name: Build
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 5
|
|
steps:
|
|
|
|
- name: Set up Go
|
|
uses: actions/setup-go@v3
|
|
with:
|
|
go-version: '1.18'
|
|
|
|
- name: Check out code into the Go module directory
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Get dependencies
|
|
run: go mod download
|
|
|
|
- name: Build
|
|
run: go vet . && go build -v .
|
|
|
|
# Very noisy, temporarily disabled
|
|
# - name: Run coverage
|
|
# run: go test -race -coverprofile=coverage.out -covermode=atomic ./...
|
|
#
|
|
# - name: Upload coverage to Codecov
|
|
# uses: codecov/codecov-action@v3
|
|
|
|
# run acceptance tests in a matrix with Terraform core versions
|
|
test:
|
|
name: Matrix Test
|
|
needs: build
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 15
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
# list whatever Terraform versions here you would like to support
|
|
terraform:
|
|
- '1.2.9'
|
|
- '1.3.8'
|
|
- '1.4.2'
|
|
steps:
|
|
|
|
- name: Set up Go
|
|
uses: actions/setup-go@v3
|
|
with:
|
|
go-version: '1.18'
|
|
|
|
- name: Check out code into the Go module directory
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Get dependencies
|
|
run: go mod download
|
|
|
|
- name: TF acceptance tests
|
|
timeout-minutes: 10
|
|
env:
|
|
TF_ACC: "1"
|
|
TF_ACC_TERRAFORM_VERSION: ${{ matrix.terraform }}
|
|
run: go test -v -cover ./...
|
|
|
|
all-tests-passed:
|
|
name: All Tests Passed
|
|
needs: test
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- run: echo "PASS"
|