Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add GitHub actions instead of Travis for Go CI tests #3914

Merged
merged 2 commits into from
May 20, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
118 changes: 118 additions & 0 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
name: Go Tests

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:

full-test:
name: Full SDK and tools test
# Tests for activily maintained Go versions.
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
go-version:
- 1.15.x
- 1.16.x
steps:
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go-version }}

- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 1

- name: Test
shell: bash
run: |
if [ "${{ matrix.os }}" == "windows-latest" ]; then
make unit-no-verify
else
make get-deps-verify ci-test
fi

deprecated-go-module-tests:
needs: full-test
name: Deprecated Go versions with module support
# Tests for deprecated Go versions with module support
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
go-version:
- 1.12.x
- 1.13.x
- 1.14.x
steps:
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go-version }}

- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 1

- name: Test
shell: bash
run: make unit-old-go-race-cover

deprecated-pre-go-module-tests:
needs: full-test
name: Deprecated Go versions without module support
# Tests for deprecated Go versions without module support
#
# setup-go doesn't play well with old Go versions that need GOPATH
# * https://github.com/actions/setup-go/issues/14
# * https://github.com/actions/setup-go/issues/12
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
go-version:
- 1.5.x
- 1.6.x
- 1.7.x
- 1.8.x
- 1.9.x
- 1.10.x
- 1.11.x
- 1.12.x
exclude:
- os: macos-latest
go-version: 1.5.x
- os: macos-latest
go-version: 1.6.x
include:
- os: windows-latest
go-version: 1.12.x
steps:
- name: Setup Go env
shell: bash
run: |
echo "GOPATH=${{ github.workspace }}/go" >> $GITHUB_ENV
echo "${{ github.workspace }}/go/bin" >> $GITHUB_PATH

- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go-version }}

- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 1
path: go/src/github.com/aws/aws-sdk-go

- name: Test
shell: bash
working-directory: go/src/github.com/aws/aws-sdk-go
run: make get-deps unit-old-go-race-cover
73 changes: 15 additions & 58 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,70 +1,27 @@
language: go

sudo: required
dist: bionic

branches:
only:
- main

os:
- linux
- osx
- linux
- osx
# Travis doesn't work with windows and Go tip
#- windows

go:
- 1.5.x
- 1.6.x
- 1.7.x
- 1.8.x
- 1.9.x
- 1.10.x
- 1.11.x
- 1.12.x
- 1.13.x
- 1.14.x
- 1.15.x
- 1.16.x
- tip
- tip

matrix:
allow_failures:
- go: tip
exclude:
# OSX 1.6.4 is not present in travis.
# https://github.com/travis-ci/travis-ci/issues/10309
- go: 1.6.x
os: osx
- go: 1.5.x
os: osx
include:
- os: windows
go: 1.12.x
- os: windows
go: 1.13.x
- os: windows
go: 1.14.x
- os: windows
go: 1.15.x
- os: windows
go: 1.16.x
- os: windows
go: tip
allow_failures:
- go: tip

before_install:
- if [ "$TRAVIS_OS_NAME" = "windows" ]; then choco install make; fi
- (cd /tmp/; go get golang.org/x/lint/golint)

script:
- if [ -z $(go env GOMOD) ]; then
make get-deps;
fi;
if [ "$TRAVIS_GO_VERSION" == "tip" ] ||
[ "$TRAVIS_GO_VERSION" == "1.16.x" ] ||
[ "$TRAVIS_GO_VERSION" == "1.15.x" ]; then

if [ "$TRAVIS_OS_NAME" = "windows" ]; then
make unit-no-verify;
else
make get-deps-verify;
make ci-test;
fi
else
make unit-old-go-race-cover;
fi
script: make get-deps-verify ci-test

branches:
only:
- main