Skip to content
This repository was archived by the owner on Jul 31, 2025. It is now read-only.

Commit 91b7214

Browse files
authored
Add GitHub actions instead of Travis for Go CI tests (#3914)
Updates the SDK's CI to use GitHub actions intead of Travis for most CI tasks. Travis is still used for Go tip.
1 parent 925d846 commit 91b7214

File tree

2 files changed

+133
-58
lines changed

2 files changed

+133
-58
lines changed

.github/workflows/go.yml

Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
name: Go Tests
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
11+
full-test:
12+
name: Full SDK and tools test
13+
# Tests for activily maintained Go versions.
14+
runs-on: ${{ matrix.os }}
15+
strategy:
16+
matrix:
17+
os: [ubuntu-latest, macos-latest, windows-latest]
18+
go-version:
19+
- 1.15.x
20+
- 1.16.x
21+
steps:
22+
- name: Setup Go
23+
uses: actions/setup-go@v2
24+
with:
25+
go-version: ${{ matrix.go-version }}
26+
27+
- name: Checkout
28+
uses: actions/checkout@v2
29+
with:
30+
fetch-depth: 1
31+
32+
- name: Test
33+
shell: bash
34+
run: |
35+
if [ "${{ matrix.os }}" == "windows-latest" ]; then
36+
make unit-no-verify
37+
else
38+
make get-deps-verify ci-test
39+
fi
40+
41+
deprecated-go-module-tests:
42+
needs: full-test
43+
name: Deprecated Go versions with module support
44+
# Tests for deprecated Go versions with module support
45+
runs-on: ${{ matrix.os }}
46+
strategy:
47+
matrix:
48+
os: [ubuntu-latest, macos-latest, windows-latest]
49+
go-version:
50+
- 1.12.x
51+
- 1.13.x
52+
- 1.14.x
53+
steps:
54+
- name: Setup Go
55+
uses: actions/setup-go@v2
56+
with:
57+
go-version: ${{ matrix.go-version }}
58+
59+
- name: Checkout
60+
uses: actions/checkout@v2
61+
with:
62+
fetch-depth: 1
63+
64+
- name: Test
65+
shell: bash
66+
run: make unit-old-go-race-cover
67+
68+
deprecated-pre-go-module-tests:
69+
needs: full-test
70+
name: Deprecated Go versions without module support
71+
# Tests for deprecated Go versions without module support
72+
#
73+
# setup-go doesn't play well with old Go versions that need GOPATH
74+
# * https://github.com/actions/setup-go/issues/14
75+
# * https://github.com/actions/setup-go/issues/12
76+
runs-on: ${{ matrix.os }}
77+
strategy:
78+
matrix:
79+
os: [ubuntu-latest, macos-latest]
80+
go-version:
81+
- 1.5.x
82+
- 1.6.x
83+
- 1.7.x
84+
- 1.8.x
85+
- 1.9.x
86+
- 1.10.x
87+
- 1.11.x
88+
- 1.12.x
89+
exclude:
90+
- os: macos-latest
91+
go-version: 1.5.x
92+
- os: macos-latest
93+
go-version: 1.6.x
94+
include:
95+
- os: windows-latest
96+
go-version: 1.12.x
97+
steps:
98+
- name: Setup Go env
99+
shell: bash
100+
run: |
101+
echo "GOPATH=${{ github.workspace }}/go" >> $GITHUB_ENV
102+
echo "${{ github.workspace }}/go/bin" >> $GITHUB_PATH
103+
104+
- name: Setup Go
105+
uses: actions/setup-go@v2
106+
with:
107+
go-version: ${{ matrix.go-version }}
108+
109+
- name: Checkout
110+
uses: actions/checkout@v2
111+
with:
112+
fetch-depth: 1
113+
path: go/src/github.com/aws/aws-sdk-go
114+
115+
- name: Test
116+
shell: bash
117+
working-directory: go/src/github.com/aws/aws-sdk-go
118+
run: make get-deps unit-old-go-race-cover

.travis.yml

Lines changed: 15 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,70 +1,27 @@
11
language: go
2-
32
sudo: required
3+
dist: bionic
4+
5+
branches:
6+
only:
7+
- main
48

59
os:
6-
- linux
7-
- osx
10+
- linux
11+
- osx
12+
# Travis doesn't work with windows and Go tip
13+
#- windows
14+
815
go:
9-
- 1.5.x
10-
- 1.6.x
11-
- 1.7.x
12-
- 1.8.x
13-
- 1.9.x
14-
- 1.10.x
15-
- 1.11.x
16-
- 1.12.x
17-
- 1.13.x
18-
- 1.14.x
19-
- 1.15.x
20-
- 1.16.x
21-
- tip
16+
- tip
2217

2318
matrix:
24-
allow_failures:
25-
- go: tip
26-
exclude:
27-
# OSX 1.6.4 is not present in travis.
28-
# https://github.com/travis-ci/travis-ci/issues/10309
29-
- go: 1.6.x
30-
os: osx
31-
- go: 1.5.x
32-
os: osx
33-
include:
34-
- os: windows
35-
go: 1.12.x
36-
- os: windows
37-
go: 1.13.x
38-
- os: windows
39-
go: 1.14.x
40-
- os: windows
41-
go: 1.15.x
42-
- os: windows
43-
go: 1.16.x
44-
- os: windows
45-
go: tip
19+
allow_failures:
20+
- go: tip
4621

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

50-
script:
51-
- if [ -z $(go env GOMOD) ]; then
52-
make get-deps;
53-
fi;
54-
if [ "$TRAVIS_GO_VERSION" == "tip" ] ||
55-
[ "$TRAVIS_GO_VERSION" == "1.16.x" ] ||
56-
[ "$TRAVIS_GO_VERSION" == "1.15.x" ]; then
57-
58-
if [ "$TRAVIS_OS_NAME" = "windows" ]; then
59-
make unit-no-verify;
60-
else
61-
make get-deps-verify;
62-
make ci-test;
63-
fi
64-
else
65-
make unit-old-go-race-cover;
66-
fi
26+
script: make get-deps-verify ci-test
6727

68-
branches:
69-
only:
70-
- main

0 commit comments

Comments
 (0)