starlog/.github/workflows/quality.yml
2026-03-19 16:37:57 +08:00

72 lines
1.5 KiB
YAML

name: quality
on:
push:
branches:
- main
- master
pull_request:
jobs:
unit:
name: unit-${{ matrix.os }}-go${{ matrix.go-version }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- windows-latest
go-version:
- "1.16.x"
- "1.22.x"
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
cache: true
- name: Run unit tests
run: go test ./...
race:
name: race-linux
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: "1.22.x"
cache: true
- name: Run race tests
run: go test -race ./...
perf-fuzz-smoke:
name: bench-fuzz-smoke
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: "1.22.x"
cache: true
- name: Benchmark smoke
run: go test . -run '^$' -bench Benchmark -benchmem -benchtime=100x
- name: Fuzz smoke text-json
run: go test . -run '^$' -fuzz=FuzzTextAndJSONFormatter -fuzztime=2s
- name: Fuzz smoke keyword
run: go test . -run '^$' -fuzz=FuzzKeywordHighlight -fuzztime=2s