chore: update doc #27
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
branches: | |
- main | |
paths-ignore: | |
- "!**/*.go" | |
- "!go.*" | |
- "!*.go" | |
pull_request: | |
paths-ignore: | |
- "!**/*.go" | |
- "!go.*" | |
- "!*.go" | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
go-version: ["1.19", "1.21.x"] | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Setup Go ${{ matrix.go-version }} | |
uses: actions/setup-go@v5 | |
with: | |
go-version: ${{ matrix.go-version }} | |
cache-dependency-path: go.sum | |
cache: true | |
- name: Install dependencies | |
run: make install | |
- name: Build | |
run: make build | |
- name: Unit test | |
run: make test | |
- name: Upload coverage to Codecov | |
uses: codecov/codecov-action@v4 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
file: coverage.out | |
flags: unittests | |
- name: Upload coverage | |
uses: actions/upload-artifact@v3 | |
with: | |
name: coverage | |
path: coverage.out | |
- name: Benchmark test | |
run: make bench | |
# - name: Upload coverage to Codacy | |
# # run: bash <(curl -Ls https://coverage.codacy.com/get.sh) report -r coverage.out --force-language go -t ${{ secrets.CODACY_PROJECT_TOKEN }} | |
# uses: codacy/codacy-coverage-reporter-action@v1 | |
# with: | |
# project-token: ${{ secrets.CODACY_PROJECT_TOKEN }} | |
# coverage-reports: coverage.out | |
# - name: Run Codacy Analysis CLI | |
# uses: codacy/codacy-analysis-cli-action@master | |
static-check: | |
strategy: | |
fail-fast: false | |
matrix: | |
os: ["windows-latest", "ubuntu-latest", "macOS-latest"] | |
go: ["1.19"] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 1 | |
- uses: dominikh/[email protected] | |
with: | |
version: latest | |
install-go: false | |
cache-key: ${{ matrix.go }} |