Skip to content

Commit 1464897

Browse files
committed
simplify the ci workflow
1 parent 954697f commit 1464897

File tree

1 file changed

+15
-53
lines changed

1 file changed

+15
-53
lines changed

.github/workflows/workflow.yaml

Lines changed: 15 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -2,64 +2,26 @@ name: Go
22

33
on:
44
push:
5+
branches: [main]
56
pull_request:
6-
branches:
7-
- master
7+
branches: [main]
88

99
jobs:
10-
golangci-lint:
10+
build:
1111
runs-on: ubuntu-latest
1212
steps:
13-
- uses: actions/checkout@v4
14-
- uses: actions/setup-go@v5
15-
with:
16-
go-version: stable
17-
- name: golangci-lint
18-
uses: golangci/golangci-lint-action@v6
19-
with:
20-
version: latest
21-
tests:
22-
runs-on: ${{ matrix.os }}
23-
strategy:
24-
fail-fast: false
25-
matrix:
26-
go-version: ["1.20", "1.21", "1.22", "1.23", "1.24"]
27-
os: [ubuntu-latest, macos-latest, windows-latest]
28-
env:
29-
OS: ${{ matrix.os }}
30-
GOVERSION: ${{ matrix.go-version }}
31-
steps:
32-
- uses: actions/checkout@v4
33-
- name: Setup Go ${{ matrix.go-version }}
34-
uses: actions/setup-go@v5
35-
with:
36-
go-version: ${{ matrix.go-version }}
37-
check-latest: true
38-
cache: true
39-
- name: Display Go version
40-
run: go version
41-
- name: Install dependencies
42-
run: make setup
43-
- name: Test
44-
run: make ci
45-
- name: Archive code coverage results
46-
uses: actions/upload-artifact@v4
13+
- uses: actions/checkout@v2
14+
15+
- name: Set up Go
16+
uses: actions/setup-go@v2
4717
with:
48-
name: code-coverage-report-${{ matrix.os }}-${{ matrix.go-version }}
49-
path: coverage.txt
18+
go-version: latest
5019

51-
coverage:
52-
needs: tests
53-
runs-on: ubuntu-latest
20+
- name: Build
21+
run: make build
5422

55-
steps:
56-
- name: Download a linux coverage report
57-
uses: actions/download-artifact@v4
58-
with:
59-
name: code-coverage-report-ubuntu-latest-1.24
60-
- name: Upload coverage to Codecov
61-
uses: codecov/codecov-action@v4
62-
with:
63-
token: ${{ secrets.CODECOV_TOKEN }}
64-
fail_ci_if_error: true
65-
flags: unittest
23+
- name: Test
24+
run: make test
25+
26+
- name: Lint
27+
run: make lint

0 commit comments

Comments
 (0)