From 29b19fdcc38ab0167e3d72ef18b542be798c8ab0 Mon Sep 17 00:00:00 2001 From: Katy Moe Date: Mon, 1 Feb 2021 21:53:58 +0000 Subject: [PATCH] move to GitHub Actions --- .github/workflows/test.yml | 74 ++++++++++++++++++++++++++++++++++++++ .travis.yml | 37 ------------------- 2 files changed, 74 insertions(+), 37 deletions(-) create mode 100644 .github/workflows/test.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 00000000..4f55b869 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,74 @@ +name: Tests +on: + pull_request: + branches: [ main ] + paths-ignore: + - 'README.md' + - 'CHANGELOG.md' + - 'website/*' + push: + branches: [ main ] + paths-ignore: + - 'README.md' + - 'CHANGELOG.md' + - 'website/*' +jobs: + build: + name: Build + runs-on: ubuntu-latest + timeout-minutes: 5 + steps: + + - name: Set up Go + uses: actions/setup-go@v2.1.3 + with: + go-version: '1.15' + id: go + + - name: Check out code into the Go module directory + uses: actions/checkout@v2.3.3 + + - name: Go fmt + run: | + make fmt + + - name: Go vet + run: | + make vet + + - 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: + terraform: + - '0.12.30' + - '0.13.6' + - '0.14.5' + steps: + + - name: Set up Go + uses: actions/setup-go@v2.1.3 + with: + go-version: '1.15' + id: go + + - name: Check out code into the Go module directory + uses: actions/checkout@v2.3.3 + + - name: TF acceptance tests + timeout-minutes: 10 + env: + TF_ACC: "1" + TF_ACC_TERRAFORM_VERSION: ${{ matrix.terraform }} + run: | + bash internal/provider/acceptance.sh diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 0249c7b3..00000000 --- a/.travis.yml +++ /dev/null @@ -1,37 +0,0 @@ -dist: focal -sudo: required -services: -- docker -language: go -go: - - stable - - tip -env: - - GO111MODULE=on GOFLAGS=-mod=vendor DOCKER_CLI_EXPERIMENTAL=enabled - -before_install: - - mkdir -vp ~/.docker/cli-plugins/ - - curl --silent -L "https://github.com/docker/buildx/releases/download/v0.5.1/buildx-v0.5.1.linux-amd64" > ~/.docker/cli-plugins/docker-buildx - - chmod a+x ~/.docker/cli-plugins/docker-buildx - -install: -# This script is used by the Travis build to install a cookie for -# go.googlesource.com so rate limits are higher when using `go get` to fetch -# packages that live there. -# See: https://github.com/golang/go/issues/12933 -- bash scripts/gogetcookie.sh -- sudo DEBIAN_FRONTEND=noninteractive apt-get install -yq krb5-user - -script: -- make test -- echo 127.0.0.1 ns.example.com | sudo tee -a /etc/hosts -- bash internal/provider/acceptance.sh -- make vet - -branches: - only: - - master -matrix: - fast_finish: true - allow_failures: - - go: tip