0
0
mirror of https://github.com/bpg/terraform-provider-proxmox.git synced 2025-06-30 18:42:58 +00:00
terraform-provider-proxmox/.github/workflows/test.yml
Pavel Boldyrev 06bd5aef0f
chore: set up code coverage (#215)
* chore: set up code coverage

* reformat docs
2023-01-22 23:58:52 -05:00

80 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 .
- 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.1.9'
- '1.2.9'
- '1.3.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"