chore: optimize github action

main
sudo pacman -Syu 2023-03-30 16:44:51 +07:00
parent 717e4d0a32
commit ee08eaeca1
1 changed files with 14 additions and 6 deletions

View File

@ -4,9 +4,21 @@ on:
push: push:
branches: branches:
- main - main
paths:
- "**.go"
- "go.mod"
- "go.sum"
pull_request: pull_request:
branches: branches:
- main - main
paths:
- "**.go"
- "go.mod"
- "go.sum"
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs: jobs:
test: test:
@ -16,9 +28,7 @@ jobs:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- uses: actions/setup-go@v4 - uses: actions/setup-go@v4
with: with:
go-version: "1.20" go-version: "stable"
check-latest: true
cache: true
- run: go test -race -failfast ./... - run: go test -race -failfast ./...
build: build:
name: Build name: Build
@ -30,7 +40,5 @@ jobs:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- uses: actions/setup-go@v4 - uses: actions/setup-go@v4
with: with:
go-version: "1.20" go-version: "stable"
check-latest: true
cache: true
- run: go build . - run: go build .