From f3cd444236fb0625130801c656e959cf18ed5a55 Mon Sep 17 00:00:00 2001 From: ofekshenawa Date: Mon, 15 Jul 2024 11:23:24 +0300 Subject: [PATCH 1/9] Add codecov to ci --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index e7df5dfd6..c7951a4d4 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,7 @@ [![build workflow](https://github.com/redis/go-redis/actions/workflows/build.yml/badge.svg)](https://github.com/redis/go-redis/actions) [![PkgGoDev](https://pkg.go.dev/badge/github.com/redis/go-redis/v9)](https://pkg.go.dev/github.com/redis/go-redis/v9?tab=doc) [![Documentation](https://img.shields.io/badge/redis-documentation-informational)](https://redis.uptrace.dev/) +[![codecov](https://codecov.io/github/redis/go-redis/graph/badge.svg?token=tsrCZKuSSw)](https://codecov.io/github/redis/go-redis) [![Chat](https://discordapp.com/api/guilds/752070105847955518/widget.png)](https://discord.gg/rWtp5Aj) > go-redis is brought to you by :star: [**uptrace/uptrace**](https://github.com/uptrace/uptrace). From 36c86d058a167f35a406fef712637fcaf54c267a Mon Sep 17 00:00:00 2001 From: ofekshenawa Date: Mon, 15 Jul 2024 11:23:55 +0300 Subject: [PATCH 2/9] Add codecov to ci --- .github/workflows/coverage.yaml | 42 +++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 .github/workflows/coverage.yaml diff --git a/.github/workflows/coverage.yaml b/.github/workflows/coverage.yaml new file mode 100644 index 000000000..83ca24b36 --- /dev/null +++ b/.github/workflows/coverage.yaml @@ -0,0 +1,42 @@ +name: Go + +on: + push: + branches: + - main + pull_request: + branches: + - main + +jobs: + build: + runs-on: ubuntu-latest + + services: + redis: + image: redis/redis-stack-server:edge + options: >- + --health-cmd "redis-cli ping" --health-interval 10s --health-timeout 5s --health-retries 5 + ports: + - 6379:6379 + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Set up Go + uses: actions/setup-go@v2 + with: + go-version: 1.21 + + - name: Install dependencies + run: go mod tidy + + - name: Run tests + run: go test -coverprofile=coverage.out ./... + + - name: Upload to Codecov + uses: codecov/codecov-action@v4 + with: + files: coverage.out + token: ${{ secrets.CODECOV_TOKEN }} From c78d60b81240296af4c88c1d3c89bd0cad093a4d Mon Sep 17 00:00:00 2001 From: ofekshenawa Date: Mon, 15 Jul 2024 11:29:27 +0300 Subject: [PATCH 3/9] update yanl --- .github/workflows/coverage.yaml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/coverage.yaml b/.github/workflows/coverage.yaml index 83ca24b36..113a6de4c 100644 --- a/.github/workflows/coverage.yaml +++ b/.github/workflows/coverage.yaml @@ -2,11 +2,9 @@ name: Go on: push: - branches: - - main + branches: [master] pull_request: - branches: - - main + branches: [master] jobs: build: From 130815247ac369c6aa717cfef75eb379401fd958 Mon Sep 17 00:00:00 2001 From: ofekshenawa Date: Mon, 22 Jul 2024 16:38:48 +0300 Subject: [PATCH 4/9] Add changes --- .github/workflows/coverage.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/coverage.yaml b/.github/workflows/coverage.yaml index 113a6de4c..901cbc2cd 100644 --- a/.github/workflows/coverage.yaml +++ b/.github/workflows/coverage.yaml @@ -23,12 +23,12 @@ jobs: uses: actions/checkout@v2 - name: Set up Go - uses: actions/setup-go@v2 + uses: actions/setup-go@v5 with: - go-version: 1.21 + go-version-file: 'go.mod' - name: Install dependencies - run: go mod tidy + run: go mod download - name: Run tests run: go test -coverprofile=coverage.out ./... From 445f105c67df85a9173e13d1d29757f2fd948996 Mon Sep 17 00:00:00 2001 From: ofekshenawa Date: Mon, 22 Jul 2024 17:02:13 +0300 Subject: [PATCH 5/9] Add changes --- .github/workflows/coverage.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/coverage.yaml b/.github/workflows/coverage.yaml index 901cbc2cd..d02c7da21 100644 --- a/.github/workflows/coverage.yaml +++ b/.github/workflows/coverage.yaml @@ -31,7 +31,7 @@ jobs: run: go mod download - name: Run tests - run: go test -coverprofile=coverage.out ./... + run: go test -race -coverprofile=coverage.txt -covermode=atomic ./... - name: Upload to Codecov uses: codecov/codecov-action@v4 From 6b10016dae142504573bc1aaa79e30dcfab86f62 Mon Sep 17 00:00:00 2001 From: ofekshenawa Date: Mon, 22 Jul 2024 17:04:07 +0300 Subject: [PATCH 6/9] test --- .github/workflows/coverage.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/coverage.yaml b/.github/workflows/coverage.yaml index d02c7da21..862cdd823 100644 --- a/.github/workflows/coverage.yaml +++ b/.github/workflows/coverage.yaml @@ -36,5 +36,5 @@ jobs: - name: Upload to Codecov uses: codecov/codecov-action@v4 with: - files: coverage.out + files: coverage.txt token: ${{ secrets.CODECOV_TOKEN }} From 68a1a3cba308581ea3bd4661cc379bafeb4f64bc Mon Sep 17 00:00:00 2001 From: ofekshenawa Date: Mon, 22 Jul 2024 17:11:07 +0300 Subject: [PATCH 7/9] Add changes --- .github/workflows/build.yml | 6 +++++ .github/workflows/coverage.yaml | 40 --------------------------------- Makefile | 1 + 3 files changed, 7 insertions(+), 40 deletions(-) delete mode 100644 .github/workflows/coverage.yaml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4061bbdff..a5f5b769a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -37,3 +37,9 @@ jobs: - name: Test run: make test + + - name: Upload to Codecov + uses: codecov/codecov-action@v4 + with: + files: coverage.txt + token: ${{ secrets.CODECOV_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/coverage.yaml b/.github/workflows/coverage.yaml deleted file mode 100644 index 862cdd823..000000000 --- a/.github/workflows/coverage.yaml +++ /dev/null @@ -1,40 +0,0 @@ -name: Go - -on: - push: - branches: [master] - pull_request: - branches: [master] - -jobs: - build: - runs-on: ubuntu-latest - - services: - redis: - image: redis/redis-stack-server:edge - options: >- - --health-cmd "redis-cli ping" --health-interval 10s --health-timeout 5s --health-retries 5 - ports: - - 6379:6379 - - steps: - - name: Checkout code - uses: actions/checkout@v2 - - - name: Set up Go - uses: actions/setup-go@v5 - with: - go-version-file: 'go.mod' - - - name: Install dependencies - run: go mod download - - - name: Run tests - run: go test -race -coverprofile=coverage.txt -covermode=atomic ./... - - - name: Upload to Codecov - uses: codecov/codecov-action@v4 - with: - files: coverage.txt - token: ${{ secrets.CODECOV_TOKEN }} diff --git a/Makefile b/Makefile index d8d007596..387ba054d 100644 --- a/Makefile +++ b/Makefile @@ -14,6 +14,7 @@ test: testdeps go test ./... -short -race && \ go test ./... -run=NONE -bench=. -benchmem && \ env GOOS=linux GOARCH=386 go test && \ + go test -race -coverprofile=coverage.txt -covermode=atomic ./... \ go vet); \ done cd internal/customvet && go build . From 7bc11bf2b5781a290649c9d51da8e83707b1e77b Mon Sep 17 00:00:00 2001 From: ofekshenawa Date: Mon, 22 Jul 2024 17:17:14 +0300 Subject: [PATCH 8/9] Add changes --- .github/workflows/build.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a5f5b769a..c9c495799 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -39,7 +39,7 @@ jobs: run: make test - name: Upload to Codecov - uses: codecov/codecov-action@v4 - with: - files: coverage.txt - token: ${{ secrets.CODECOV_TOKEN }} \ No newline at end of file + uses: codecov/codecov-action@v4 + with: + files: coverage.txt + token: ${{ secrets.CODECOV_TOKEN }} \ No newline at end of file From 39c9610d37556f41efbd746477e5f682b418b4c4 Mon Sep 17 00:00:00 2001 From: ofekshenawa Date: Mon, 22 Jul 2024 17:25:29 +0300 Subject: [PATCH 9/9] Add changes --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 387ba054d..1a6bd1786 100644 --- a/Makefile +++ b/Makefile @@ -14,7 +14,7 @@ test: testdeps go test ./... -short -race && \ go test ./... -run=NONE -bench=. -benchmem && \ env GOOS=linux GOARCH=386 go test && \ - go test -race -coverprofile=coverage.txt -covermode=atomic ./... \ + go test -coverprofile=coverage.txt -covermode=atomic ./... && \ go vet); \ done cd internal/customvet && go build .