Add Unit Tests for UpdateAuthor Handler #52
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: Go Test for API Module | |
on: | |
push: | |
paths: | |
- 'api/**' | |
- '.github/workflows/**' | |
branches: | |
- main | |
- develop | |
pull_request: | |
paths: | |
- 'api/**' | |
- '.github/workflows/**' | |
branches: | |
- main | |
- develop | |
jobs: | |
test-api: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: '1.22.0' | |
- name: Verify Go installation | |
run: go version | |
- name: Cache Go modules | |
uses: actions/cache@v4 | |
with: | |
path: | | |
~/go/pkg/mod | |
~/.cache/go-build | |
key: ${{ runner.os }}-go-${{ hashFiles('api/go.sum') }} | |
restore-keys: | | |
${{ runner.os }}-go- | |
- name: Install dependencies | |
run: go mod tidy | |
working-directory: ./api | |
- name: Run unit tests | |
run: go test -v ./... | |
working-directory: ./api |