Skip to content

Commit

Permalink
Introduce github actions to validate commits
Browse files Browse the repository at this point in the history
  • Loading branch information
PapaCharlie committed Feb 5, 2024
1 parent 67688ea commit da4f072
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 42 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/integration.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: integration_test
on: [push, pull_request]

jobs:
integration_test:
name: integration_test
strategy:
matrix:
zk-version: ["3.5.8", "3.6.3"]
go-version: ["1.21"]
runs-on: ubuntu-latest
steps:
- name: Go ${{ matrix.go-version }} setup
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go-version }}

- name: Setup Java 14
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: 14

- name: Checkout code
uses: actions/checkout@v4

- name: Test code
run: make test ZK_VERSION=${{ matrix.zk-version }}

- name: Upload code coverage
uses: codecov/codecov-action@v1
with:
file: ./profile.cov
19 changes: 13 additions & 6 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,21 @@

name: lint
on: [pull_request]
on: [push, pull_request]

jobs:
lint:
name: lint
strategy:
matrix:
go-version: ["1.21"]
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v1
- name: Lint code
uses: reviewdog/action-golangci-lint@v1
uses: actions/checkout@v4

- name: Install go
uses: actions/setup-go@v4
with:
github_token: ${{ secrets.github_token }}
go-version: ${{ matrix.go-version }}

- name: Lint code
uses: golangci/golangci-lint-action@v3
32 changes: 0 additions & 32 deletions .github/workflows/unittest.yaml

This file was deleted.

6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
Native Go Zookeeper Client Library
===================================

[![GoDoc](https://godoc.org/github.com/go-zookeeper/zk?status.svg)](https://godoc.org/github.com/go-zookeeper/zk)
[![Build Status](https://img.shields.io/github/workflow/status/go-zookeeper/zk/unittest/master)](https://github.com/go-zookeeper/zk/actions?query=branch%3Amaster)
[![Coverage Status](https://img.shields.io/codecov/c/github/go-zookeeper/zk/master)](https://codecov.io/gh/go-zookeeper/zk/branch/master)
[![GoDoc](https://godoc.org/github.com/linkedin/go-zk?status.svg)](https://godoc.org/github.com/linkedin/go-zk)
[![Build status](https://github.com/linkedin/go-zk/actions/workflows/integration.yaml/badge.svg)](https://github.com/linkedin/go-zk/actions/workflows/integration.yaml)
[![Coverage Status](https://img.shields.io/codecov/c/github/linkedin/go-zk/master)](https://codecov.io/gh/linkedin/go-zk/branch/master)

License
-------
Expand Down
2 changes: 1 addition & 1 deletion server_help_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ func requireNoErrorf(t *testing.T, err error, msgAndArgs ...interface{}) {
func RequireMinimumZkVersion(t *testing.T, minimum string) {
if val, ok := os.LookupEnv("ZK_VERSION"); ok {
split := func(v string) (parts []int) {
for _, s := range strings.Split(minimum, ".") {
for _, s := range strings.Split(v, ".") {
i, err := strconv.Atoi(s)
if err != nil {
t.Fatalf("invalid version segment: %q", s)
Expand Down

0 comments on commit da4f072

Please sign in to comment.