Skip to content

Commit

Permalink
Add testing for Go Tip and Go 1.16 and get rid of Travis CI and Go 1.…
Browse files Browse the repository at this point in the history
…14. (google#615)

* Add testing for Go Tip and Go 1.16

* Add 1.16 support for Linux
  • Loading branch information
wyk9787 authored Apr 6, 2021
1 parent 8eee249 commit ec78c8a
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 74 deletions.
59 changes: 44 additions & 15 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,29 @@ jobs:
working-directory: ${{ env.WORKING_DIR }}
strategy:
matrix:
go: ['1.14', '1.15']
go: ['1.15', '1.16', 'tip']
# Supported macOS versions can be found in
# https://github.com/actions/virtual-environments#available-environments.
os: ['macos-10.15']
xcode-version: ['12.2', '12.1', '12.0', '11.7', '11.6', '11.5', '11.4.1', '11.3.1', '11.2.1']
# Supported Xcode versions can be found in
# https://github.com/actions/virtual-environments/blob/main/images/macos/macos-10.15-Readme.md#xcode.
xcode-version: ['12.4', '12.3', '12.2', '12.1.1', '12.0.1', '11.7']
steps:
- name: Update go version
- name: Update Go version using setup-go
uses: actions/setup-go@v2
if: matrix.go != 'tip'
with:
go-version: ${{ matrix.go }}

- name: Update Go version manually
if: matrix.go == 'tip'
working-directory: ${{ github.workspace }}
run: |
git clone https://go.googlesource.com/go $HOME/gotip
cd $HOME/gotip/src
./make.bash
echo "GOROOT=$HOME/gotip" >> $GITHUB_ENV
echo "$HOME/gotip/bin:$PATH" >> $GITHUB_PATH
- name: Checkout the repo
uses: actions/checkout@v2
Expand All @@ -38,15 +53,16 @@ jobs:
xcode-version: ${{ matrix.xcode-version }}

- name: Fetch dependencies
# Do not let tools interfere with the main module's go.mod.
env:
GO111MODULE: off
run: |
brew install graphviz
go get -u golang.org/x/lint/golint honnef.co/go/tools/cmd/...
# Do not let tools interfere with the main module's go.mod.
cd && go get -u golang.org/x/lint/golint honnef.co/go/tools/cmd/...
# Add PATH for installed tools.
echo "$GOPATH/bin:$PATH" >> $GITHUB_PATH
- name: Run the script
run: |
go version
gofmtdiff=$(gofmt -s -d .) && if [ -n "$gofmtdiff" ]; then printf 'gofmt -s found:\n%s\n' "$gofmtdiff" && exit 1; fi
golintlint=$(golint ./...) && if [ -n "$golintlint" ]; then printf 'golint found:\n%s\n' "$golintlint" && exit 1; fi
go vet -all ./...
Expand All @@ -72,29 +88,41 @@ jobs:
working-directory: ${{ env.WORKING_DIR }}
strategy:
matrix:
go: ['1.14', '1.15']
go: ['1.15', '1.16', 'tip']
os: ['ubuntu-20.04', 'ubuntu-18.04', 'ubuntu-16.04']
steps:
- name: Update go version
- name: Update Go version using setup-go
uses: actions/setup-go@v2
if: matrix.go != 'tip'
with:
go-version: ${{ matrix.go }}

- name: Update Go version manually
if: matrix.go == 'tip'
working-directory: ${{ github.workspace }}
run: |
git clone https://go.googlesource.com/go $HOME/gotip
cd $HOME/gotip/src
./make.bash
echo "GOROOT=$HOME/gotip" >> $GITHUB_ENV
echo "$HOME/gotip/bin" >> $GITHUB_PATH
- name: Checkout the repo
uses: actions/checkout@v2
with:
path: ${{ env.WORKING_DIR }}

- name: Fetch dependencies
# Do not let tools interfere with the main module's go.mod.
env:
GO111MODULE: off
run: |
sudo apt-get install graphviz
go get -u golang.org/x/lint/golint honnef.co/go/tools/cmd/...
# Do not let tools interfere with the main module's go.mod.
cd && go get -u golang.org/x/lint/golint honnef.co/go/tools/cmd/...
# Add PATH for installed tools.
echo "PATH=$GOPATH/bin:$PATH" >> $GITHUB_ENV
- name: Run the script
run: |
go version
gofmtdiff=$(gofmt -s -d .) && if [ -n "$gofmtdiff" ]; then printf 'gofmt -s found:\n%s\n' "$gofmtdiff" && exit 1; fi
golintlint=$(golint ./...) && if [ -n "$golintlint" ]; then printf 'golint found:\n%s\n' "$golintlint" && exit 1; fi
go vet -all ./...
Expand All @@ -116,9 +144,9 @@ jobs:
runs-on: windows-2019
strategy:
matrix:
go: ['1.14', '1.15']
go: ['1.15', '1.16']
steps:
- name: Update go version
- name: Update Go version using setup-go
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go }}
Expand All @@ -135,6 +163,7 @@ jobs:

- name: Run the test
run: |
go version
# This is a workaround to make graphviz installed through choco work.
# It generates a config file to tell dot what layout engine and
# format types are available. See
Expand Down
59 changes: 0 additions & 59 deletions .travis.yml

This file was deleted.

0 comments on commit ec78c8a

Please sign in to comment.