From c6cf2591a2b74642c23c6e3e1c70da86512c8d42 Mon Sep 17 00:00:00 2001 From: Jeevanandam M Date: Wed, 25 Sep 2024 22:39:37 -0700 Subject: [PATCH] build: update go minimum version to go1.21 for package slices usage --- .github/workflows/ci.yml | 11 +++++++---- .github/workflows/label-actions.yml | 11 +++++++---- go.mod | 2 +- 3 files changed, 15 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 130b9506..ebaab1ac 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,7 +25,7 @@ jobs: name: Build strategy: matrix: - go: [ 'stable', '1.20.x' ] + go: [ 'stable', '1.21.x' ] os: [ ubuntu-latest ] runs-on: ${{ matrix.os }} @@ -47,9 +47,12 @@ jobs: run: diff -u <(echo -n) <(go fmt $(go list ./...)) - name: Test - run: go test ./... -race -coverprofile=coverage.txt -covermode=atomic -coverpkg=./... + run: go test ./... -race -count=1 -coverprofile=coverage.txt -covermode=atomic -coverpkg=./... -shuffle=on - name: Upload coverage to Codecov + if: ${{ matrix.os == 'ubuntu-latest' && matrix.go == 'stable' }} uses: codecov/codecov-action@v4 - env: - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + with: + token: ${{ secrets.CODECOV_TOKEN }} + file: ./coverage.txt + flags: unittests diff --git a/.github/workflows/label-actions.yml b/.github/workflows/label-actions.yml index bab02b45..8fee6ffa 100644 --- a/.github/workflows/label-actions.yml +++ b/.github/workflows/label-actions.yml @@ -12,7 +12,7 @@ jobs: build: strategy: matrix: - go: [ 'stable', '1.20.x' ] + go: [ 'stable', '1.21.x' ] os: [ ubuntu-latest ] name: Run Build @@ -36,9 +36,12 @@ jobs: run: diff -u <(echo -n) <(go fmt $(go list ./...)) - name: Test - run: go test ./... -race -coverprofile=coverage.txt -covermode=atomic -coverpkg=./... + run: go test ./... -race -count=1 -coverprofile=coverage.txt -covermode=atomic -coverpkg=./... -shuffle=on - name: Upload coverage to Codecov + if: ${{ matrix.os == 'ubuntu-latest' && matrix.go == 'stable' }} uses: codecov/codecov-action@v4 - env: - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + with: + token: ${{ secrets.CODECOV_TOKEN }} + file: ./coverage.txt + flags: unittests diff --git a/go.mod b/go.mod index 47a301a6..c7064d45 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/go-resty/resty/v3 -go 1.20 +go 1.21 require ( golang.org/x/net v0.27.0