fix #420
This file contains hidden or 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: Tests | |
| on: | |
| push: | |
| branches: [ main ] | |
| pull_request: | |
| branches: [ main ] | |
| jobs: | |
| test_only: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v3 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set timezone | |
| uses: szenius/set-timezone@v1.0 | |
| with: | |
| timezoneLinux: "Asia/Shanghai" | |
| - name: Set up Go | |
| uses: actions/setup-go@v2 | |
| with: | |
| go-version: 1.25.5 | |
| - name: Go mod tidy | |
| run: go mod tidy | |
| - name: Unit tests | |
| run: go test -coverprofile=cover_no.out ./... | |
| - name: Clean cover_no.out | |
| run: rm ./cover_no.out | |
| test_cover: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v3 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set timezone | |
| uses: szenius/set-timezone@v1.0 | |
| with: | |
| timezoneLinux: "Asia/Shanghai" | |
| - name: Set up Go | |
| uses: actions/setup-go@v2 | |
| with: | |
| go-version: 1.26.4 | |
| - name: Go mod tidy | |
| run: go mod tidy | |
| - name: Unit tests | |
| run: go test -coverprofile=cover.out ./... | |
| - name: Upload coverage reports to Codecov | |
| uses: codecov/codecov-action@v5 | |
| env: | |
| CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
| with: | |
| files: cover.out |