0
0
mirror of https://github.com/bpg/terraform-provider-proxmox.git synced 2025-06-30 02:31:10 +00:00

update various project configs, mostly for CI

This commit is contained in:
Pavel Boldyrev 2021-09-08 21:48:02 -04:00
parent 26664468c5
commit 968f775cf6
No known key found for this signature in database
GPG Key ID: 9A3B05A2B8921AD9
5 changed files with 122 additions and 53 deletions

31
.github/dependabot.yml vendored Normal file
View File

@ -0,0 +1,31 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
- package-ecosystem: "gomod"
directory: "/"
ignore:
- dependency-name: "golang.org/x/tools"
- dependency-name: "google.golang.org/grpc"
schedule:
interval: "daily"
- package-ecosystem: "gomod"
directory: "/awsproviderlint"
ignore:
- dependency-name: "golang.org/x/tools"
- dependency-name: "google.golang.org/grpc"
schedule:
interval: "daily"
- package-ecosystem: "gomod"
directory: "/tools"
ignore:
- dependency-name: "golang.org/x/tools"
- dependency-name: "google.golang.org/grpc"
schedule:
interval: "daily"
- package-ecosystem: "terraform"
directory: "/infrastructure/repository"
schedule:
interval: "daily"

View File

@ -1,34 +1,72 @@
name: Test changes
# This GitHub action runs your tests for each commit push and/or PR. Optionally
# you can turn it on using a cron schedule for regular testing.
#
name: Tests
on:
pull_request:
branches:
- main
- master
- 'release/v*'
paths-ignore:
- 'README.md'
push:
paths-ignore:
- 'README.md'
jobs:
test:
name: Pull Request
runs-on: ubuntu-20.04
# ensure the code builds...
build:
name: Build
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
-
name: Checkout the code
uses: actions/checkout@v2
with:
fetch-depth: 0
-
name: Install and configure Go
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.15
-
name: Install and configure GoReleaser
go-version: '1.16'
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@v2
- name: Get dependencies
run: |
go mod download
- name: Build
run: |
go build -v .
# 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:
- '0.14.11'
- '0.15.5'
- '1.0.6'
steps:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: '1.16'
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@v2
- name: Get dependencies
run: |
go mod download
- name: TF acceptance tests
timeout-minutes: 10
env:
GORELEASER_VERSION: '0.155.1'
TF_ACC: "1"
TF_ACC_TERRAFORM_VERSION: ${{ matrix.terraform }}
run: |
curl -sL -o goreleaser_amd64.deb "https://github.com/goreleaser/goreleaser/releases/download/v${GORELEASER_VERSION}/goreleaser_amd64.deb"
sudo dpkg -i goreleaser_amd64.deb
rm -f goreleaser_amd64.deb
-
name: Create snapshot
run: |
goreleaser build --parallelism 2 --rm-dist --snapshot --timeout 1h
go test -v -cover ./...

1
.go-version Normal file
View File

@ -0,0 +1 @@
1.16.0

View File

@ -1,48 +1,47 @@
archives:
- files:
- none*
format: zip
name_template: '{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}'
before:
hooks:
- go mod tidy
- go mod download
builds:
- env:
- CGO_ENABLED=0
mod_timestamp: '{{ .CommitTimestamp }}'
- binary: '{{ .ProjectName }}_{{ .Version }}'
flags:
- -trimpath
ldflags:
- '-s -w -X main.version={{.Version}} -X main.commit={{.Commit}}'
goos:
- freebsd
- windows
- linux
- darwin
goarch:
- amd64
- '386'
- amd64
- arm
- arm64
goos:
- darwin
- freebsd
- linux
- windows
ignore:
- goos: darwin
goarch: '386'
binary: '{{ .ProjectName }}_v{{ .Version }}'
archives:
- format: zip
name_template: '{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}'
- goarch: '386'
goos: darwin
ldflags:
- -s -w -X version.ProviderVersion={{.Version}}
mod_timestamp: '{{ .CommitTimestamp }}'
changelog:
skip: true
checksum:
name_template: '{{ .ProjectName }}_{{ .Version }}_SHA256SUMS'
algorithm: sha256
env:
- CGO_ENABLED=0
release:
disable: true
signs:
- artifacts: checksum
args:
- "--batch"
- "--local-user"
- "{{ .Env.GPG_FINGERPRINT }}"
- "{{ .Env.GPG_FINGERPRINT }}" # set this environment variable for your signing key
- "--output"
- "${signature}"
- "--passphrase-fd"
- "0"
- "--detach-sign"
- "${artifact}"
stdin_file: /tmp/.gpg_passphrase
release:
draft: false
changelog:
skip: true

View File

@ -6,7 +6,7 @@ A Terraform Provider which adds support for Proxmox solutions.
## Requirements
- [Terraform](https://www.terraform.io/downloads.html) 0.13+
- [Go](https://golang.org/doc/install) 1.15+ (to build the provider plugin)
- [Go](https://golang.org/doc/install) 1.16+ (to build the provider plugin)
- [GoReleaser](https://goreleaser.com/install/) 0.155+ (to build the provider plugin)
## Table of Contents