From 125844155baef5f8142ddada8994fdd7001649b7 Mon Sep 17 00:00:00 2001 From: aereal Date: Tue, 12 Dec 2023 20:56:41 +0900 Subject: [PATCH 1/3] ci: update actions --- .github/workflows/ci.yml | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a815416..7a1a0d1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,7 +10,7 @@ jobs: lint: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: lint uses: reviewdog/action-golangci-lint@v2 test: @@ -25,16 +25,10 @@ jobs: - ubuntu-latest runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v3 - - uses: actions/setup-go@v3 + - uses: actions/checkout@v4 + - uses: actions/setup-go@v5 with: go-version: ${{ matrix.go_version }} - - uses: actions/cache@v3 - with: - path: ~/go/pkg/mod - key: ${{ runner.os }}-go-${{ matrix.go_version }}-${{ hashFiles('**/go.sum') }} - restore-keys: | - ${{ runner.os }}-go-${{ matrix.go_version }} - name: test run: go test -race -coverprofile=coverage.txt -covermode=atomic ./... - uses: codecov/codecov-action@v3 From c86e976eae28c9466cc338c5bac228525f2ea1dd Mon Sep 17 00:00:00 2001 From: aereal Date: Tue, 12 Dec 2023 21:01:10 +0900 Subject: [PATCH 2/3] ci: use octcov instead codecov --- .github/workflows/ci.yml | 22 ++++++++++++++++++++-- .octocov.yml | 22 ++++++++++++++++++++++ 2 files changed, 42 insertions(+), 2 deletions(-) create mode 100644 .octocov.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7a1a0d1..cf23b46 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -30,6 +30,24 @@ jobs: with: go-version: ${{ matrix.go_version }} - name: test - run: go test -race -coverprofile=coverage.txt -covermode=atomic ./... - - uses: codecov/codecov-action@v3 + run: go test -race -coverprofile=cover.out -covermode=atomic ./... + - uses: actions/upload-artifact@v3 if: matrix.os == 'ubuntu-latest' && matrix.go_version == '1.17.x' + with: + name: coverage + path: ./cover.out + if-no-files-found: error + report-coverage: + runs-on: ubuntu-latest + permissions: + actions: read + contents: read + pull-requests: write + needs: + - test + steps: + - uses: actions/checkout@v4 + - uses: actions/download-artifact@v3 + with: + name: coverage + - uses: k1LoW/octocov-action@v0 diff --git a/.octocov.yml b/.octocov.yml new file mode 100644 index 0000000..8cb02b1 --- /dev/null +++ b/.octocov.yml @@ -0,0 +1,22 @@ +--- + +coverage: + if: true +codeToTestRatio: + code: + - '**/*.go' + - '!**/*_test.go' + test: + - '**/*_test.go' +testExecutionTime: + if: true +diff: + datastores: + - artifact://${GITHUB_REPOSITORY} +report: + datastores: + - artifact://${GITHUB_REPOSITORY} +comment: + if: is_pull_request +summary: + if: is_pull_request From 386ca2e0e2d5a0935fd7d1a314d2683f7b429dd4 Mon Sep 17 00:00:00 2001 From: aereal Date: Tue, 12 Dec 2023 21:05:55 +0900 Subject: [PATCH 3/3] ci: run tests against latest 3 versions --- .github/workflows/ci.yml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cf23b46..7fc24d2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,10 +17,9 @@ jobs: strategy: matrix: go_version: - - 1.14.x - - 1.15.x - - 1.16.x - - 1.17.x + - 1.21.x + - 1.20.x + - 1.19.x os: - ubuntu-latest runs-on: ${{ matrix.os }} @@ -32,7 +31,7 @@ jobs: - name: test run: go test -race -coverprofile=cover.out -covermode=atomic ./... - uses: actions/upload-artifact@v3 - if: matrix.os == 'ubuntu-latest' && matrix.go_version == '1.17.x' + if: strategy.job-index == 0 with: name: coverage path: ./cover.out