mirror of
https://github.com/bpg/terraform-provider-proxmox.git
synced 2025-06-30 18:42:58 +00:00
84 lines
2.8 KiB
YAML
84 lines
2.8 KiB
YAML
name: Acceptance Tests
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
inputs:
|
|
ref:
|
|
description: 'Branch or tag to run tests against'
|
|
required: true
|
|
default: 'main'
|
|
|
|
jobs:
|
|
acceptance:
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
terraform: [ 1.6 ]
|
|
os: [ ubuntu-24.04, windows-latest, macos-latest ]
|
|
include:
|
|
- os: ubuntu-24.04
|
|
node: pve1
|
|
port: 13451
|
|
- os: windows-latest
|
|
node: pve2
|
|
port: 13452
|
|
- os: macos-latest
|
|
node: pve3
|
|
port: 13453
|
|
runs-on: ${{ matrix.os }}
|
|
timeout-minutes: 30
|
|
environment: pve-acc
|
|
steps:
|
|
- name: Dump GitHub context
|
|
env:
|
|
GITHUB_CONTEXT: ${{ toJson(github) }}
|
|
run: echo "$GITHUB_CONTEXT"
|
|
|
|
- name: Checkout
|
|
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
|
|
with:
|
|
fetch-depth: 1
|
|
ref: ${{ github.event.inputs.ref || github.ref}}
|
|
|
|
- name: Setup Go
|
|
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5
|
|
with:
|
|
go-version-file: "go.mod"
|
|
cache-dependency-path: "**/*.sum"
|
|
|
|
- name: Get dependencies
|
|
run: go mod download
|
|
|
|
- name: Set up gotestfmt
|
|
run: go install github.com/gotesttools/gotestfmt/v2/cmd/gotestfmt@latest
|
|
|
|
- uses: hashicorp/setup-terraform@b9cd54a3c349d3f38e8881555d616ced269862dd # v3.1.2
|
|
with:
|
|
terraform_version: ${{ matrix.terraform }}.*
|
|
terraform_wrapper: false
|
|
|
|
- name: Acceptance tests
|
|
timeout-minutes: 30
|
|
env:
|
|
TF_ACC: 1
|
|
PROXMOX_VE_INSECURE: false
|
|
PROXMOX_VE_API_TOKEN: "${{ secrets.PROXMOX_VE_API_TOKEN }}"
|
|
PROXMOX_VE_ENDPOINT: "https://${{ secrets.PROXMOX_VE_HOST }}:8006/"
|
|
PROXMOX_VE_SSH_AGENT: false
|
|
PROXMOX_VE_SSH_USERNAME: "terraform"
|
|
PROXMOX_VE_SSH_PRIVATE_KEY: "${{ secrets.PROXMOX_VE_SSH_PRIVATE_KEY }}"
|
|
PROXMOX_VE_ACC_NODE_NAME: ${{ matrix.node }}
|
|
PROXMOX_VE_ACC_NODE_SSH_ADDRESS: ${{ secrets.PROXMOX_VE_HOST }}
|
|
PROXMOX_VE_ACC_NODE_SSH_PORT: ${{ matrix.port }}
|
|
PROXMOX_VE_ACC_CLOUD_IMAGES_SERVER: ${{ secrets.PROXMOX_VE_ACC_CLOUD_IMAGES_SERVER }}
|
|
PROXMOX_VE_ACC_CONTAINER_IMAGES_SERVER: ${{ secrets.PROXMOX_VE_ACC_CONTAINER_IMAGES_SERVER }}
|
|
run:
|
|
go test -json --timeout=30m --tags=acceptance -count=1 -v github.com/bpg/terraform-provider-proxmox/fwprovider/... 2>&1 | tee ${{ runner.temp }}/gotest-${{ matrix.os }}.log | gotestfmt -hide empty-packages
|
|
|
|
- name: Upload test log
|
|
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
|
|
if: always()
|
|
with:
|
|
name: test-log-${{ matrix.os }}
|
|
path: ${{ runner.temp }}/gotest-${{ matrix.os }}.log
|