Add unit test workflow for pull requests #5
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: Unit Tests | |
| on: | |
| workflow_dispatch: | |
| pull_request: | |
| types: | |
| - opened | |
| - reopened | |
| - synchronize | |
| - ready_for_review | |
| merge_group: | |
| types: | |
| - checks_requested | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| unit-tests: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| go-version: ['1.22.x', '1.23.x'] | |
| os: [ubuntu-latest, windows-latest] | |
| name: Unit Tests | |
| runs-on: ${{ matrix.os }} | |
| timeout-minutes: 30 | |
| steps: | |
| - uses: actions/setup-go@v5 | |
| with: | |
| go-version: ${{ matrix.go-version }} | |
| cache: true | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup test environment | |
| run: | | |
| go version | |
| go env | |
| - name: Download dependencies | |
| run: go mod download | |
| - name: Run unit tests | |
| run: make test-all | |
| timeout-minutes: 25 |