From 76dbfa9a61df5f996ecdc4d06b90032fb535f8c4 Mon Sep 17 00:00:00 2001 From: Piotr Piotrowski Date: Fri, 19 Apr 2024 18:50:07 +0200 Subject: [PATCH] Add test job Signed-off-by: Piotr Piotrowski --- .github/workflows/ci.yaml | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index d2a39c50c..0aa691781 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -12,7 +12,6 @@ jobs: uses: actions/setup-go@v5 with: go-version: 1.22 - cache: false - name: Install deps shell: bash --noprofile --norc -x -eo pipefail {0} @@ -30,3 +29,32 @@ jobs: GOFLAGS="-mod=mod -modfile=go_test.mod" staticcheck ./... find . -type f -name "*.go" | xargs misspell -error -locale US golangci-lint run --timeout 5m0s ./jetstream/... + + test: + runs-on: ubuntu-latest + + strategy: + matrix: + go: [ "1.21", "1.22" ] + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Setup Go + uses: actions/setup-go@v5 + with: + go-version: ${{ matrix.go }} + - name: Install deps + shell: bash --noprofile --norc -x -eo pipefail {0} + run: | + go install github.com/mattn/goveralls@latest + go install github.com/wadey/gocovmerge@latest + + - name: Test and coverage + run: | + go test -modfile=go_test.mod -v -run=TestNoRace -p=1 ./... --failfast -vet=off + if [ "${{ matrix.go }}" = "1.21" ]; then + ./scripts/cov.sh + elif [ "${{ matrix.go }}" = "1.22" ]; then + go test -modfile=go_test.mod -race -v -p=1 ./... --failfast -vet=off -tags=internal_testing + fi \ No newline at end of file