mirror of
https://github.com/ysoftdevs/terraform-provider-bitbucketserver.git
synced 2026-04-30 12:34:13 +02:00
Port to GitHub actions & publish to Terraform registry (#39)
* Port to GitHub actions * Fix * Make docs terraform registry compatible
This commit is contained in:
92
.github/workflows/build.yml
vendored
Normal file
92
.github/workflows/build.yml
vendored
Normal file
@@ -0,0 +1,92 @@
|
||||
name: "Build"
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [master]
|
||||
pull_request:
|
||||
branches: [master]
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
GO111MODULE: on
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Set up GO 1.16.x
|
||||
uses: actions/setup-go@v1
|
||||
with:
|
||||
go-version: '1.16'
|
||||
- run: echo "$(go env GOPATH)/bin" >> $GITHUB_PATH
|
||||
- name: Setup Environment
|
||||
run: make ci-build-setup
|
||||
- name: Build
|
||||
run: make build
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
GO111MODULE: on
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Set up GO 1.16.x
|
||||
uses: actions/setup-go@v1
|
||||
with:
|
||||
go-version: '1.16'
|
||||
- run: echo "$(go env GOPATH)/bin" >> $GITHUB_PATH
|
||||
- name: Setup Environment
|
||||
run: make ci-build-setup
|
||||
- name: Run tests
|
||||
run: make test
|
||||
testacc:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
GO111MODULE: on
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Set up GO 1.16.x
|
||||
uses: actions/setup-go@v1
|
||||
with:
|
||||
go-version: '1.16'
|
||||
- run: echo "$(go env GOPATH)/bin" >> $GITHUB_PATH
|
||||
- name: Login to Docker Hub
|
||||
uses: docker/login-action@v1
|
||||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
- name: Setup Environment
|
||||
run: make ci-build-setup
|
||||
- name: Start bitbucket server
|
||||
run: make bitbucket-start
|
||||
- name: Run acceptance tests
|
||||
run: BITBUCKET_SERVER=http://localhost:7990 BITBUCKET_USERNAME=admin BITBUCKET_PASSWORD=admin make testacc
|
||||
- name: Stop bitbucket server
|
||||
run: make bitbucket-stop
|
||||
fmtcheck:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
GO111MODULE: on
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Set up GO 1.16.x
|
||||
uses: actions/setup-go@v1
|
||||
with:
|
||||
go-version: '1.16'
|
||||
- run: echo "$(go env GOPATH)/bin" >> $GITHUB_PATH
|
||||
- name: Setup Environment
|
||||
run: make ci-build-setup
|
||||
- name: Format check
|
||||
run: make fmtcheck
|
||||
vet:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
GO111MODULE: on
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Set up GO 1.16.x
|
||||
uses: actions/setup-go@v1
|
||||
with:
|
||||
go-version: '1.16'
|
||||
- run: echo "$(go env GOPATH)/bin" >> $GITHUB_PATH
|
||||
- name: Setup Environment
|
||||
run: make ci-build-setup
|
||||
- name: Run vet
|
||||
run: make vet
|
||||
40
.github/workflows/tag.yml
vendored
Normal file
40
.github/workflows/tag.yml
vendored
Normal file
@@ -0,0 +1,40 @@
|
||||
name: Release
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- "v*"
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
jobs:
|
||||
goreleaser:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v2
|
||||
with:
|
||||
go-version: 1.16
|
||||
- name: Import GPG key
|
||||
id: import_gpg
|
||||
uses: crazy-max/ghaction-import-gpg@v3
|
||||
with:
|
||||
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
|
||||
passphrase: ${{ secrets.GPG_PASSPHRASE }}
|
||||
- name: Run GoReleaser
|
||||
uses: goreleaser/goreleaser-action@v2
|
||||
with:
|
||||
version: latest
|
||||
args: release --rm-dist
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }}
|
||||
- name: Upload assets
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
path: dist/*
|
||||
Reference in New Issue
Block a user