mirror of
https://github.com/bolucat/Archive.git
synced 2025-12-24 13:28:37 +08:00
52 lines
930 B
YAML
52 lines
930 B
YAML
name: check-code
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
paths:
|
|
- "cmd/**"
|
|
- "internal/**"
|
|
- "pkg/**"
|
|
pull_request:
|
|
branches:
|
|
- master
|
|
paths:
|
|
- "cmd/**"
|
|
- "internal/**"
|
|
- "pkg/**"
|
|
- "go.mod"
|
|
jobs:
|
|
test:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Set up Go
|
|
uses: actions/setup-go@v5
|
|
with:
|
|
go-version: "1.21"
|
|
id: go
|
|
|
|
- name: Check out code into the Go module directory
|
|
uses: actions/checkout@v4
|
|
|
|
- uses: actions/cache@v4
|
|
with:
|
|
path: |
|
|
~/.cache/go-build
|
|
~/go/pkg/mod
|
|
key: ${{ runner.os }}-go-${{ hashFiles('go.sum') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-go-
|
|
|
|
- name: tidy
|
|
run: make tidy
|
|
|
|
- name: lint
|
|
run: make lint
|
|
|
|
- name: test
|
|
run: make test
|
|
|
|
- name: build
|
|
run: make build
|