49 lines
1.0 KiB
YAML
49 lines
1.0 KiB
YAML
name: Test
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
push:
|
|
paths:
|
|
- 'cmd/**'
|
|
- 'pkg/**'
|
|
- 'scripts/**'
|
|
- 'go.mod'
|
|
- 'main.go'
|
|
- '.github/actions/test/**'
|
|
- '.github/workflows/test.yml'
|
|
pull_request:
|
|
paths:
|
|
- 'cmd/**'
|
|
- 'pkg/**'
|
|
- 'scripts/**'
|
|
- 'go.mod'
|
|
- 'main.go'
|
|
- '.github/actions/test/**'
|
|
- '.github/workflows/test.yml'
|
|
|
|
permissions:
|
|
contents: write
|
|
|
|
env:
|
|
COVERAGE_FILE: ./cover.out
|
|
|
|
jobs:
|
|
test:
|
|
runs-on: ubuntu-latest
|
|
if: ${{ !startsWith(github.ref, 'refs/tags/') }}
|
|
steps:
|
|
- uses: actions/checkout@v5
|
|
- uses: actions/setup-go@v5
|
|
with:
|
|
go-version-file: ./go.mod
|
|
- uses: eat-pray-ai/yutu/.github/actions/test@main
|
|
- uses: ncruces/go-coverage-report@v0
|
|
with:
|
|
coverage-file: ${{ env.COVERAGE_FILE }}
|
|
badge-style: flat-square
|
|
chart: true
|
|
amend: true
|
|
if: |
|
|
github.event_name == 'push' &&
|
|
github.ref == 'refs/heads/main'
|