From 9a9e13fa983b5391fb6d2dbaedd2cb2865123c82 Mon Sep 17 00:00:00 2001 From: Dmitriy Shirchenko Date: Mon, 17 May 2021 15:17:02 -0700 Subject: [PATCH] Switch from Travis to GitHub Actions (#940) We're deprecating use of Travis for our OSS projects, so switch to GitHub Actions for it. Unfortunately, this required dropping tests we had against ppc64le because [GitHub Workflows doesn't support it][1]. [1]: https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#github-hosted-runners --- .github/workflows/go.yml | 52 ++++++++++++++++++++++++++++++++++++++++ .travis.yml | 28 ---------------------- README.md | 4 ++-- 3 files changed, 54 insertions(+), 30 deletions(-) create mode 100644 .github/workflows/go.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml new file mode 100644 index 000000000..d174d4129 --- /dev/null +++ b/.github/workflows/go.yml @@ -0,0 +1,52 @@ +name: Go + +on: + push: + branches: ['*'] + tags: ['v*'] + pull_request: + branches: ['*'] + +jobs: + + build: + runs-on: ubuntu-latest + strategy: + matrix: + go: ["1.15.x", "1.16.x"] + include: + - go: 1.16.x + latest: true + + steps: + - name: Setup Go + uses: actions/setup-go@v2 + with: + go-version: ${{ matrix.go }} + + - name: Checkout code + uses: actions/checkout@v2 + + - name: Load cached dependencies + uses: actions/cache@v1 + with: + path: ~/go/pkg/mod + key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} + restore-keys: | + ${{ runner.os }}-go- + + - name: Download Dependencies + run: go mod download + + - name: Lint + if: matrix.latest + run: make lint + + - name: Test + run: make cover + + - name: Upload coverage to codecov.io + uses: codecov/codecov-action@v1 + + - name: Benchmark + run: make bench diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 0a4c5e6ec..000000000 --- a/.travis.yml +++ /dev/null @@ -1,28 +0,0 @@ -language: go - -sudo: false - -go_import_path: go.uber.org/zap -env: - global: - - TEST_TIMEOUT_SCALE=10 - - GO111MODULE=on - -matrix: - include: - - go: oldstable - - go: stable - env: LINT=1 - - arch: ppc64le - go: oldstable - - arch: ppc64le - go: stable - -script: - - test -z "$LINT" || make lint - - make test - - make bench - -after_success: - - make cover - - bash <(curl -s https://codecov.io/bash) diff --git a/README.md b/README.md index a3a5c09bd..1e64d6cff 100644 --- a/README.md +++ b/README.md @@ -125,8 +125,8 @@ pinned in the [benchmarks/go.mod][] file. [↩](#anchor-versions) [doc-img]: https://pkg.go.dev/badge/go.uber.org/zap [doc]: https://pkg.go.dev/go.uber.org/zap -[ci-img]: https://travis-ci.com/uber-go/zap.svg?branch=master -[ci]: https://travis-ci.com/uber-go/zap +[ci-img]: https://github.com/uber-go/zap/actions/workflows/go.yml/badge.svg +[ci]: https://github.com/uber-go/zap/actions/workflows/go.yml [cov-img]: https://codecov.io/gh/uber-go/zap/branch/master/graph/badge.svg [cov]: https://codecov.io/gh/uber-go/zap [benchmarking suite]: https://github.com/uber-go/zap/tree/master/benchmarks