Merge pull request #93 from sue445/revive_exported #180
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: test | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
types: | |
- opened | |
- synchronize | |
- reopened | |
env: | |
GO111MODULE: "on" | |
TEST_ARGS: -coverprofile coverage.out -covermode atomic | |
jobs: | |
test: | |
name: test | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
golang: | |
- "1.18" | |
- "1.19" | |
- "1.20" | |
- "1.21" | |
- "1.22" | |
steps: | |
- name: Check out code into the Go module directory | |
uses: actions/checkout@v4 | |
- name: Set up Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: ${{ matrix.golang }} | |
id: go | |
- name: Run test | |
run: | | |
set -xe | |
make test | |
make testrace | |
- name: Convert coverage to lcov | |
uses: jandelgado/gcov2lcov-action@v1 | |
with: | |
infile: coverage.out | |
outfile: coverage.lcov | |
- name: Coveralls | |
uses: coverallsapp/github-action@master | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
path-to-lcov: coverage.lcov | |
- name: Slack Notification (not success) | |
uses: act10ns/slack@v2 | |
if: "! success()" | |
continue-on-error: true | |
with: | |
status: ${{ job.status }} | |
webhook-url: ${{ secrets.SLACK_WEBHOOK }} | |
matrix: ${{ toJson(matrix) }} | |
lint: | |
name: lint | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out code into the Go module directory | |
uses: actions/checkout@v4 | |
- name: Set up Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version-file: "go.mod" | |
id: go | |
- name: golangci-lint | |
uses: golangci/golangci-lint-action@v6 | |
with: | |
version: v1.58 | |
- name: Slack Notification (not success) | |
uses: act10ns/slack@v2 | |
if: "! success()" | |
continue-on-error: true | |
with: | |
status: ${{ job.status }} | |
webhook-url: ${{ secrets.SLACK_WEBHOOK }} | |
notify: | |
needs: | |
- test | |
- lint | |
runs-on: ubuntu-latest | |
steps: | |
- name: Slack Notification (success) | |
uses: act10ns/slack@v2 | |
if: always() | |
continue-on-error: true | |
with: | |
status: ${{ job.status }} | |
webhook-url: ${{ secrets.SLACK_WEBHOOK }} |