0
0
mirror of https://github.com/bpg/terraform-provider-proxmox.git synced 2025-06-30 02:31:10 +00:00
terraform-provider-proxmox/.github/workflows/test.yml
Pavel Boldyrev 268c861649
chore: improve acceptance tests on CI (#1173)
Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
2024-04-07 04:41:57 +00:00

102 lines
2.5 KiB
YAML

name: Tests
on:
pull_request: {}
push:
branches:
- main
jobs:
build:
name: Build
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Filter paths
uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
id: filter
with:
filters: |
go:
- '**/*.go'
- name: Setup Go
if: ${{ steps.filter.outputs.go == 'true' }}
uses: actions/setup-go@v5
with:
go-version-file: "go.mod"
cache-dependency-path: "**/*.sum"
- name: Get dependencies
if: ${{ steps.filter.outputs.go == 'true' }}
run: go mod download
- name: Build
if: ${{ steps.filter.outputs.go == 'true' }}
run: go vet . && go build -v .
test:
name: Unit Tests
needs: build
runs-on: ubuntu-latest
steps:
- name: Dump GitHub context
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: echo "$GITHUB_CONTEXT"
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Filter paths
uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
id: filter
with:
filters: |
go:
- '**/*.go'
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version-file: "go.mod"
cache-dependency-path: "**/*.sum"
- name: Get dependencies
if: ${{ steps.filter.outputs.go == 'true' }}
run: go mod download
- name: Unit tests
if: ${{ steps.filter.outputs.go == 'true' }}
timeout-minutes: 10
run: go test -v -cover ./...
- name: Check for uncommitted changes in generated docs
run: make docs && git diff --exit-code
testacc:
if: ${{ !contains(github.head_ref, 'renovate/') && !contains(github.head_ref, 'release-please') && !contains(github.head_ref, 'dependabot') && github.repository == 'bpg/terraform-provider-proxmox' }}
name: Dispatch Acceptance Tests
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Filter paths
uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
id: filter
with:
filters: |
go:
- '**/*.go'