Skip to content
This repository has been archived by the owner on Oct 5, 2022. It is now read-only.

Commit

Permalink
Merge pull request #12 from kinvolk/invidian/github-actions
Browse files Browse the repository at this point in the history
Add GitHub Actions workflows for acceptance tests and releases
  • Loading branch information
invidian authored Oct 8, 2020
2 parents 3a8d22a + 9a444ae commit d728bec
Show file tree
Hide file tree
Showing 4 changed files with 120 additions and 38 deletions.
71 changes: 71 additions & 0 deletions .github/workflows/acctest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: Acceptance Tests
on:
pull_request:
paths-ignore:
- 'LICENSE'
- '**.md'
- 'docs/**'
push:
paths-ignore:
- 'LICENSE'
- '**.md'
- 'docs/**'
schedule:
- cron: '0 13 * * *'

jobs:
build:
name: Build
runs-on: ubuntu-latest
timeout-minutes: 10
steps:

- name: Set up Go
uses: actions/[email protected]
with:
go-version: '1.15'
id: go

- name: Check out code into the Go module directory
uses: actions/[email protected]

- name: Get dependencies
run: make download

- name: Build
run: make build

test:
name: Matrix Test
needs: build
runs-on: ubuntu-latest
timeout-minutes: 240
strategy:
fail-fast: false
matrix:
version:
- stable
terraform:
- '0.12.29'
- '0.13.3'
steps:
- name: Set up Go
uses: actions/[email protected]
with:
go-version: '1.15'
id: go

- name: Check out code into the Go module directory
uses: actions/[email protected]

- name: Get dependencies
run: make download

- name: Start Tinkerbell server
run: make test-up

- name: TF acceptance tests
timeout-minutes: 120
env:
TF_ACC_TERRAFORM_VERSION: ${{ matrix.terraform }}
run: make testacc
47 changes: 47 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# This GitHub action can publish assets for release when a tag is created.
# Currently its setup to run on any tag that matches the pattern "v*" (ie. v0.1.0).
#
# This uses an action (paultyng/ghaction-import-gpg) that assumes you set your
# private key in the `GPG_PRIVATE_KEY` secret and passphrase in the `PASSPHRASE`
# secret. If you would rather own your own GPG handling, please fork this action
# or use an alternative one for key handling.
#
# You will need to pass the `--batch` flag to `gpg` in your signing step
# in `goreleaser` to indicate this is being used in a non-interactive mode.
#
name: release
on:
push:
tags:
- 'v*'

jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Unshallow
run: git fetch --prune --unshallow

- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.15

- name: Import GPG key
id: import_gpg
uses: paultyng/[email protected]
env:
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
PASSPHRASE: ${{ secrets.PASSPHRASE }}

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
with:
version: latest
args: release --rm-dist
env:
GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4 changes: 2 additions & 2 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ release:
# Visit your project's GitHub Releases page to publish this release.
draft: true
github:
owner: flexkube
name: terraform-provider-flexkube
owner: kinvolk
name: terraform-provider-tinkerbell
changelog:
skip: true
36 changes: 0 additions & 36 deletions .travis.yml

This file was deleted.

0 comments on commit d728bec

Please sign in to comment.