From cc54476b8c4a4b2f61dace933fa891139da4a7e5 Mon Sep 17 00:00:00 2001 From: Erik Osterman Date: Tue, 30 Jun 2020 20:32:36 -0700 Subject: [PATCH] use github actions (#19) * use github actions * run tests * run tests * fix path * update to upload artifacts * show artifacts * fix path * name artifact * Update .github/workflows/go.yml Co-authored-by: Andriy Knysh * Update .github/workflows/go.yml Co-authored-by: Andriy Knysh * Update .github/workflows/go.yml Co-authored-by: Andriy Knysh Co-authored-by: Andriy Knysh --- .github/workflows/go.yml | 56 ++++++++++++++++++++++++++++++++++++++++ .travis.yml | 32 ----------------------- glide.yaml | 0 go.mod | 3 +++ 4 files changed, 59 insertions(+), 32 deletions(-) create mode 100644 .github/workflows/go.yml delete mode 100644 .travis.yml delete mode 100644 glide.yaml create mode 100644 go.mod diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml new file mode 100644 index 0000000..e5c2efb --- /dev/null +++ b/.github/workflows/go.yml @@ -0,0 +1,56 @@ +name: 'go' + +on: + release: + types: [published] + + pull_request: + types: [opened, synchronize, reopened] + +jobs: + build: + runs-on: ubuntu-latest + steps: + # Checkout the repo + - name: 'Checkout' + uses: actions/checkout@v2 + # Build Go binaries + - name: 'Build Go binaries' + uses: cloudposse/actions/go/build@0.15.0 + env: + GO111MODULE: on + # Architectures to build for + GOX_OSARCH: >- + windows/386 + windows/amd64 + freebsd/arm + netbsd/386 + netbsd/amd64 + netbsd/arm + linux/s390x + linux/arm + darwin/386 + darwin/amd64 + linux/386 + linux/amd64 + freebsd/amd64 + freebsd/386 + openbsd/386 + openbsd/amd64 + OUTPUT_PATH: ${{ github.workspace }}/release/${{ github.event.repository.name }}_ + # Run the go tests + - name: 'Run tests' + run: find ${{ github.workspace }}; ${{ github.workspace }}/release/${{ github.event.repository.name }}_linux_amd64 + # Upload artifacts for this build + - name: 'Upload artifacts' + uses: actions/upload-artifact@v2 + with: + name: ${{ github.event.repository.name }} + path: ${{ github.workspace }}/release/* + # Attach Go binaries to GitHub Release + - name: 'Attach artifacts to GitHub Release' + if: ${{ github.event_name == 'release' }} + uses: cloudposse/actions/github/release-assets@0.15.0 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + INPUT_PATH: ${{ github.workspace }}/release/${{ github.event.repository.name }}_* diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 4a8847d..0000000 --- a/.travis.yml +++ /dev/null @@ -1,32 +0,0 @@ -sudo: required -language: go -go: - - 1.11.x -addons: - apt: - packages: - - git - - make - - curl - -install: -- make init -- make go/deps-build -- make go/deps-dev - -script: -- make go/deps -- make go/test -- make go/lint -- make go/build-all -- ls -l release/ - -deploy: - provider: releases - api_key: "$GITHUB_API_KEY" - file_glob: true - file: "release/*" - skip_cleanup: true - on: - tags: true - diff --git a/glide.yaml b/glide.yaml deleted file mode 100644 index e69de29..0000000 diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..17805f0 --- /dev/null +++ b/go.mod @@ -0,0 +1,3 @@ +module github.com/cloudposse/tfmask + +go 1.13