Skip to content

chore(deps): update actions/checkout action to v4 #94

chore(deps): update actions/checkout action to v4

chore(deps): update actions/checkout action to v4 #94

Workflow file for this run

---
name: CI
on:
pull_request:
push:
branches:
- main
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: lint
uses: reviewdog/action-golangci-lint@v2
with:
level: warning
test:
strategy:
matrix:
go_version:
- 1.18.x
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v3
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 -v -race -coverprofile=cover.os-${{ matrix.os }}.ver-${{ matrix.go_version }}.txt -covermode=atomic ./...
- name: upload coverage
uses: codecov/codecov-action@v3
if: ${{ matrix.go_version == '1.18.x' }}
with:
files: ./cover.os-${{ matrix.os }}.ver-${{ matrix.go_version }}.txt
determine_release:
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'
outputs:
will_release: ${{ steps.determine_release.outputs.new_release_published }}
steps:
- uses: actions/checkout@v4
- id: determine_release
uses: cycjimmy/semantic-release-action@v3.0.0
with:
dry_run: true
continue-on-error: true
env:
GITHUB_TOKEN: ${{ github.token }}
release:
runs-on: ubuntu-latest
needs:
- test
- lint
- determine_release
if: ${{ needs.determine_release.outputs.will_release }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: cycjimmy/semantic-release-action@v3.0.0
env:
GITHUB_TOKEN: ${{ github.token }}
- uses: actions/setup-go@v3
with:
go-version: '1.18.x'
- uses: actions/cache@v3
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-1.18.x-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- uses: goreleaser/goreleaser-action@v2.9.1
with:
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ github.token }}