Skip to content

Commit

Permalink
Support multi versions of Go for testing go functions (apache#7220)
Browse files Browse the repository at this point in the history
Signed-off-by: xiaolong.ran <[email protected]>

### Motivation

Currently, the Pulsar Go Functions is only tested against Go version 1.12. We need to verify multiple versions.

### Modifications

*Describe the modifications you've done.*

I've modified the two GitHub Action workflows that are a part of this repo with
a [matrix](https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idstrategymatrix) such that we test against multiple versions of Go.
  • Loading branch information
wolfstudy authored Jun 9, 2020
1 parent 2102c33 commit f26bab3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/ci-go-functions-style.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ jobs:
build:
name: Build
runs-on: ubuntu-latest
strategy:
matrix:
go-version: [1.11, 1.12, 1.13, 1.14]
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v2
Expand All @@ -43,11 +46,11 @@ jobs:
with:
args: site2 .github deployment .asf.yaml .ci ct.yaml

- name: Set up Go 1.12
- name: Set up Go
uses: actions/setup-go@v1
if: steps.docs.outputs.changed_only == 'no'
with:
go-version: 1.12
go-version: ${{ matrix.go-version }}
id: go

- name: InstallTool
Expand Down
11 changes: 7 additions & 4 deletions .github/workflows/ci-go-functions-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,12 @@ on:

jobs:

cpp-tests:
go-functions-tests:
name:
runs-on: ubuntu-latest
strategy:
matrix:
go-version: [1.11, 1.12, 1.13, 1.14]
timeout-minutes: 120

steps:
Expand All @@ -46,15 +49,15 @@ jobs:
with:
args: site2 .github deployment .asf.yaml .ci ct.yaml

- name: Set up Go 1.12
- name: Set up Go
uses: actions/setup-go@v1
if: steps.docs.outputs.changed_only == 'no'
with:
go-version: 1.12
go-version: ${{ matrix.go-version }}
id: go

- name: run tests
if: steps.docs.outputs.changed_only == 'no'
run: |
cd pulsar-function-go
go test -v $(go list ./... | grep -v examples)
go test -v $(go list ./... | grep -v examples) ${{ matrix.go-version }}

0 comments on commit f26bab3

Please sign in to comment.