From 656bfea9e87674fbd904c80374c27b94ac2e66b9 Mon Sep 17 00:00:00 2001 From: Dale Hamel Date: Thu, 22 Oct 2020 10:58:23 -0400 Subject: [PATCH] feat: Migrate travis CI to github actions, fixes #105 This moves the CI and release process to github actions from Travis --- .github/workflows/build-and-test.yml | 42 ++++++++++++++++++++++++++++ .github/workflows/goreleaser.yml | 26 +++++++++++++++++ .travis.yml | 26 ----------------- 3 files changed, 68 insertions(+), 26 deletions(-) create mode 100644 .github/workflows/build-and-test.yml create mode 100644 .github/workflows/goreleaser.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml new file mode 100644 index 00000000..e7bf02cd --- /dev/null +++ b/.github/workflows/build-and-test.yml @@ -0,0 +1,42 @@ +name: Kubectl trace build and tests + +on: [push, pull_request] + +jobs: + build_and_test: + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-16.04, ubuntu-18.04] # 16.04.4 release has 4.15 kernel + # 18.04.3 release has 5.0.0 kernel + steps: + - uses: actions/checkout@v2 + - name: Run tests + run: | + make test + - name: Build kubectl trace binary + run: | + make _output/bin/kubectl-trace + - name: Build CI image + run: | + ./hack/ci-build-image.sh + - name: Run integration tests + run: | + make integration + - name: Build cross binaries + run: | + curl -LO https://github.com/goreleaser/goreleaser/releases/latest/download/goreleaser_amd64.deb && sudo dpkg -i goreleaser_amd64.deb + make cross + - uses: actions/upload-artifact@v1 + with: + name: ${{ matrix.os }}-kubectl-trace-dist + path: _output/bin/kubectl-trace + - uses: actions/upload-artifact@v1 + with: + name: ${{ matrix.os }}-kubectl-trace-cross-dist + path: dist + - name: Upload docker image + if: > + github.ref == 'ref/head/master' + run: | + ./hack/ci-release-image.sh diff --git a/.github/workflows/goreleaser.yml b/.github/workflows/goreleaser.yml new file mode 100644 index 00000000..ffc0ab1d --- /dev/null +++ b/.github/workflows/goreleaser.yml @@ -0,0 +1,26 @@ +name: goreleaser + +on: + push: + tags: + - '*' + +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.14 + - name: Run GoReleaser + uses: goreleaser/goreleaser-action@v2 + with: + version: latest + args: release --rm-dist + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 28c59f27..00000000 --- a/.travis.yml +++ /dev/null @@ -1,26 +0,0 @@ -language: go -branches: - only: - - master -go: -- 1.11.4 -services: -- docker -before_install: -- curl -LO https://github.com/goreleaser/goreleaser/releases/latest/download/goreleaser_amd64.deb && sudo dpkg -i goreleaser_amd64.deb -script: -- make test -- make _output/bin/kubectl-trace -- ./hack/ci-build-image.sh -- make integration -- make cross -after_success: -- ./hack/ci-release-image.sh - -deploy: -- provider: script - skip_cleanup: true - script: goreleaser - on: - tags: true - condition: $TRAVIS_OS_NAME = linux