chore: improve acceptance tests on CI #69
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Acceptance Tests | |
on: | |
workflow_dispatch: | |
inputs: | |
ref: | |
description: 'Branch or tag to run tests against' | |
required: true | |
default: 'main' | |
push: | |
branches: | |
- main | |
pull_request: | |
jobs: | |
acceptance: | |
strategy: | |
fail-fast: false | |
matrix: | |
terraform: [ 1.6 ] | |
os: [ ubuntu-latest, windows-latest, macos-latest ] | |
include: | |
- os: ubuntu-latest | |
node: pve1 | |
port: 13451 | |
- os: windows-latest | |
node: pve2 | |
port: 13452 | |
- os: macos-latest | |
node: pve3 | |
port: 13453 | |
runs-on: ${{ matrix.os }} | |
environment: pve-acc | |
steps: | |
- name: Dump GitHub context | |
env: | |
GITHUB_CONTEXT: ${{ toJson(github) }} | |
run: echo "$GITHUB_CONTEXT" | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 1 | |
ref: ${{ github.event.inputs.ref || github.ref}} | |
- name: Setup Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version-file: "go.mod" | |
cache-dependency-path: "**/*.sum" | |
- name: Get dependencies | |
run: go mod download | |
- uses: hashicorp/setup-terraform@a1502cd9e758c50496cc9ac5308c4843bcd56d36 # v3.0.0 | |
with: | |
terraform_version: ${{ matrix.terraform }}.* | |
terraform_wrapper: false | |
- name: Acceptance tests | |
timeout-minutes: 10 | |
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 }} | |
run: make testacc |