From cfdee944f96cbe4443377ce0c422055bdc459ae0 Mon Sep 17 00:00:00 2001 From: Alex Flint Date: Fri, 3 Apr 2020 11:45:13 -0400 Subject: Set up CI using github actions --- .github/workflows/go.yml | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 .github/workflows/go.yml (limited to '.github') diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml new file mode 100644 index 0000000..8d3c1b8 --- /dev/null +++ b/.github/workflows/go.yml @@ -0,0 +1,29 @@ +name: Go + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + + build: + name: Build + runs-on: ubuntu-latest + steps: + + - name: Set up Go 1.13 + uses: actions/setup-go@v1 + with: + go-version: 1.13 + id: go + + - name: Check out code into the Go module directory + uses: actions/checkout@v2 + + - name: Build + run: go build -v . + + - name: Test + run: go test -v . -- cgit v1.2.3 From ce896f3df96474b03398c9b360bc44011646bb21 Mon Sep 17 00:00:00 2001 From: Alex Flint Date: Fri, 3 Apr 2020 12:09:49 -0400 Subject: add coverage using goveralls --- .github/workflows/go.yml | 34 +++++++++++++++++++++++++++------- 1 file changed, 27 insertions(+), 7 deletions(-) (limited to '.github') diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 8d3c1b8..927b2d5 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -8,16 +8,21 @@ on: jobs: - build: - name: Build + build_and_test: + name: Build and test runs-on: ubuntu-latest - steps: - - name: Set up Go 1.13 + strategy: + fail-fast: false + matrix: + go: ['1.11', '1.12', '1.13', '1.14'] + + steps: + - id: go + name: Set up Go uses: actions/setup-go@v1 with: - go-version: 1.13 - id: go + go-version: 1.13 # ${{ matrix.go }} - name: Check out code into the Go module directory uses: actions/checkout@v2 @@ -26,4 +31,19 @@ jobs: run: go build -v . - name: Test - run: go test -v . + run: go test -v -coverprofile=profile.cov . + + - name: Send coverage + uses: shogo82148/actions-goveralls@v1 + with: + path-to-profile: profile.cov + parallel: true + + # notifies coveralls that all test jobs are finished + finish: + needs: test + runs-on: ubuntu-latest + steps: + - uses: shogo82148/actions-goveralls@v1 + with: + parallel-finished: true \ No newline at end of file -- cgit v1.2.3 From af757bea986f79085de7dc3c49651f5bbcf70f63 Mon Sep 17 00:00:00 2001 From: Alex Flint Date: Fri, 3 Apr 2020 12:13:23 -0400 Subject: fix name of dependency --- .github/workflows/go.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to '.github') diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 927b2d5..07f5e18 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -41,9 +41,9 @@ jobs: # notifies coveralls that all test jobs are finished finish: - needs: test + needs: build_and_test runs-on: ubuntu-latest steps: - - uses: shogo82148/actions-goveralls@v1 - with: - parallel-finished: true \ No newline at end of file + - uses: shogo82148/actions-goveralls@v1 + with: + parallel-finished: true -- cgit v1.2.3 From 65ef631f5fce176d49ebee2dd68dc9cf3e693380 Mon Sep 17 00:00:00 2001 From: Alex Flint Date: Fri, 3 Apr 2020 12:19:40 -0400 Subject: use ${{ matrix.go }} --- .github/workflows/go.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to '.github') diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 07f5e18..4be256c 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -22,7 +22,7 @@ jobs: name: Set up Go uses: actions/setup-go@v1 with: - go-version: 1.13 # ${{ matrix.go }} + go-version: ${{ matrix.go }} - name: Check out code into the Go module directory uses: actions/checkout@v2 @@ -41,6 +41,7 @@ jobs: # notifies coveralls that all test jobs are finished finish: + name: Finish needs: build_and_test runs-on: ubuntu-latest steps: -- cgit v1.2.3