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

Build and test with multiple versions of Go #269

Merged
merged 1 commit into from
Jun 6, 2020
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
25 changes: 13 additions & 12 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@
name: Go
on: [pull_request]
jobs:

build:
name: Build
runs-on: ubuntu-latest
strategy:
matrix:
go-version: [1.11, 1.12, 1.13, 1.14]
steps:
- name: Set up Go
uses: actions/setup-go@v1
with:
go-version: ${{ matrix.go-version }}
id: go

- name: Set up Go 1.12
uses: actions/setup-go@v1
with:
go-version: 1.12
id: go

- name: Check out code into the Go module directory
uses: actions/checkout@v2
- name: Check out code into the Go module directory
uses: actions/checkout@v2

- name: Test
run: |
./docker-ci.sh
- name: Test
run: |
./docker-ci.sh ${{ matrix.go-version }}
9 changes: 5 additions & 4 deletions .github/workflows/project.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
name: Project Style Check
on: [pull_request]
jobs:

build:
name: Build
runs-on: ubuntu-latest
strategy:
matrix:
go-version: [1.11, 1.12, 1.13, 1.14]
steps:

- name: Set up Go 1.12
- name: Set up Go
uses: actions/setup-go@v1
with:
go-version: 1.12
go-version: ${{ matrix.go-version }}
id: go

- name: Check out code into the Go module directory
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
# under the License.
#

ARG GO_VERSION=golang:1.12
FROM apachepulsar/pulsar:latest as pulsar

FROM golang:1.12 as go
FROM $GO_VERSION as go

RUN apt-get update && apt-get install -y openjdk-11-jre-headless

Expand Down
3 changes: 2 additions & 1 deletion docker-ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ cd ${SRC_DIR}

IMAGE_NAME=pulsar-client-go-test:latest

docker build -t ${IMAGE_NAME} .
GO_VERSION=${1:-1.12}
docker build -t ${IMAGE_NAME} --build-arg GO_VERSION="golang:${GO_VERSION}" .

docker run -i -v ${PWD}:/pulsar-client-go ${IMAGE_NAME} \
bash -c "cd /pulsar-client-go && ./run-ci.sh"