diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..639a118 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,59 @@ +name: Go Modules Test + +on: [push, pull_request] + +jobs: + prepare-matrix: + runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.set-matrix.outputs.matrix }} + steps: + - uses: actions/checkout@v4 + - id: set-matrix + run: | + echo "matrix=$(find . -maxdepth 2 -type f -name 'go.mod' | xargs -n 1 dirname | sort -u | { echo "e2e"; cat; } | jq -R -s -c 'split("\n")[:-1]')" >> $GITHUB_OUTPUT + + build: + needs: prepare-matrix + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + module: ${{fromJson(needs.prepare-matrix.outputs.matrix)}} + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: '1.21.0' + + - name: Test Module + run: | + module_path=${{ matrix.module }} + if [ "$module_path" == "." ]; then + list=$(go list ./...) + echo "Test Packages: $list" + for n in {1..5}; do + ./dockertest.sh -skip 'Integration' $list && break + done + elif [ "$module_path" == "e2e" ]; then + list=$(go list ./...) + echo "Test Packages: $list" + for n in {1..5}; do + ./dockertest.sh -run 'Integration' $list && break + done + else + cd $module_path + list=$(go list ./...) + echo "Test Packages: $list" + for n in {1..5}; do + ../dockertest.sh $list && break + done + fi + + - uses: codecov/codecov-action@v4 + with: + token: ${{ secrets.CODECOV_TOKEN }} + verbose: true diff --git a/README.md b/README.md index 6cbee88..045c64e 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ [![Go Reference](https://pkg.go.dev/badge/github.com/valkey-io/valkey-go.svg)](https://pkg.go.dev/github.com/valkey-io/valkey-go) [![CircleCI](https://dl.circleci.com/status-badge/img/gh/valkey-io/valkey-go/tree/main.svg?style=shield)](https://dl.circleci.com/status-badge/redirect/gh/valkey-io/valkey-go/tree/main) [![Go Report Card](https://goreportcard.com/badge/github.com/valkey-io/valkey-go)](https://goreportcard.com/report/github.com/valkey-io/valkey-go) -[![codecov](https://codecov.io/gh/valkey-io/valkey-go/branch/main/graph/badge.svg?token=934zeTPaTc)](https://codecov.io/gh/valkey-io/valkey-go) +[![codecov](https://codecov.io/gh/valkey-io/valkey-go/branch/main/graph/badge.svg?token=26SfMHyUJ3)](https://codecov.io/gh/valkey-io/valkey-go) A fast Golang Valkey client that does auto pipelining and supports server-assisted client-side caching.