Skip to content

Commit 6e6b16d

Browse files
authored
Add GitHub actions instead of Travis for Go CI tests (#299)
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 65c03a1 commit 6e6b16d

File tree

3 files changed

+80
-28
lines changed

3 files changed

+80
-28
lines changed

Diff for: .github/workflows/codegen.yml

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Codegen Tests
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
codegen-test:
11+
name: SDK Codegen Test
12+
runs-on: ${{ matrix.os }}
13+
strategy:
14+
matrix:
15+
os: [ubuntu-latest]
16+
java-version: ['11', '8']
17+
go-version: [1.16]
18+
env:
19+
JAVA_TOOL_OPTIONS: "-Xmx2g"
20+
steps:
21+
- uses: actions/checkout@v2
22+
23+
- uses: actions/setup-java@v2
24+
with:
25+
distribution: 'zulu'
26+
java-version: ${{ matrix.java-version }}
27+
28+
- uses: actions/setup-go@v2
29+
with:
30+
go-version: ${{ matrix.go-version }}
31+
32+
- name: SDK Codegen
33+
run: cd codegen && ./gradlew clean build -Plog-tests
34+

Diff for: .github/workflows/go.yml

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Go Tests
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
unit-tests:
11+
name: Test SDK
12+
runs-on: ${{ matrix.os }}
13+
strategy:
14+
matrix:
15+
os: [ubuntu-latest, macos-latest, windows-latest]
16+
go-version: [1.16, 1.15]
17+
steps:
18+
- uses: actions/checkout@v2
19+
20+
- name: Set up Go
21+
uses: actions/setup-go@v2
22+
with:
23+
go-version: ${{ matrix.go-version }}
24+
25+
- name: Test
26+
run: go test -v ./...
27+

Diff for: .travis.yml

+19-28
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,28 @@
1-
language: java
1+
language: go
22
sudo: true
33
dist: bionic
44

5-
install:
6-
- eval "$(curl -sL https://raw.githubusercontent.com/travis-ci/gimme/master/gimme | GIMME_GO_VERSION=1.16.x bash)"
7-
- echo `go env`
8-
- echo `which go`
9-
10-
script: cd codegen && ./gradlew clean build -Plog-tests
5+
branches:
6+
only:
7+
- main
118

12-
matrix:
13-
include:
14-
- language: java
15-
go: 1.16.x
16-
jdk: openjdk8
9+
os:
10+
- linux
11+
- osx
12+
# Travis doesn't work with windows and Go tip
13+
#- windows
1714

18-
- language: java
19-
go: 1.16.x
20-
jdk: openjdk11
15+
go:
16+
- tip
2117

22-
- language: go
23-
go: 1.15.x
24-
script: go test -v ./...
18+
matrix:
19+
allow_failures:
20+
- go: tip
2521

26-
- language: go
27-
go: 1.16.x
28-
script: go test -v ./...
22+
before_install:
23+
- if [ "$TRAVIS_OS_NAME" = "windows" ]; then choco install make; fi
24+
- (cd /tmp/; go get golang.org/x/lint/golint)
2925

30-
allow_failures:
31-
- language: go
32-
go: tip
33-
script: go test -v ./...
26+
script:
27+
- make go test -v ./...;
3428

35-
branches:
36-
only:
37-
- main

0 commit comments

Comments
 (0)