Skip to content

Commit

Permalink
fix(ci): actions
Browse files Browse the repository at this point in the history
  • Loading branch information
caarlos0 committed Feb 10, 2022
1 parent b4180f7 commit cdbcd04
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 21 deletions.
23 changes: 8 additions & 15 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,34 +16,27 @@ jobs:
os: [ ubuntu-latest, macos-latest, windows-latest ]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v2
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v2
- uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go-version }}
- name: Cache Go modules
uses: actions/cache@v1
- uses: actions/cache@v2
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Dependencies
run: go mod tidy
- name: Test
run: go test -v -failfast -race -coverpkg=./... -covermode=atomic -coverprofile=coverage.txt ./...
- name: Upload coverage
uses: codecov/codecov-action@v1
- run: go mod tidy
- run: go test -v -failfast -race -coverpkg=./... -covermode=atomic -coverprofile=coverage.txt ./...
- uses: codecov/codecov-action@v2
if: matrix.os == 'ubuntu-latest'
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.txt
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
if: success() && startsWith(github.ref, 'refs/tags/') && matrix.os == 'ubuntu-latest'
- uses: goreleaser/goreleaser-action@v2
if: success() && startsWith(github.ref, 'refs/tags/') && matrix.os == 'ubuntu-latest' && matrix.go-version == '~1.17'
with:
version: latest
args: release --rm-dist
Expand Down
9 changes: 3 additions & 6 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install Go
uses: actions/setup-go@v2
- uses: actions/setup-go@v2
with:
go-version: ~1.16
- name: golangci-lint
uses: golangci/golangci-lint-action@v2
go-version: ~1.17
- uses: golangci/golangci-lint-action@v2
with:
version: v1.37
skip-go-installation: true
only-new-issues: true

0 comments on commit cdbcd04

Please sign in to comment.