Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: update actions #24

Merged
merged 3 commits into from
Dec 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 27 additions & 16 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,32 +10,43 @@ jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: lint
uses: reviewdog/action-golangci-lint@v2
test:
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 }}
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
if: matrix.os == 'ubuntu-latest' && matrix.go_version == '1.17.x'
run: go test -race -coverprofile=cover.out -covermode=atomic ./...
- uses: actions/upload-artifact@v3
if: strategy.job-index == 0
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
22 changes: 22 additions & 0 deletions .octocov.yml
Original file line number Diff line number Diff line change
@@ -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