Merge pull request #16 from Hamzenium/Added-Docker-Setup #18
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: Go CI/CD | |
| on: | |
| push: | |
| branches: | |
| - Prod # Trigger pipeline only when code is pushed to the Prod branch | |
| pull_request: | |
| branches: | |
| - Prod # Also trigger pipeline for pull requests targeting the Prod branch | |
| jobs: | |
| test: | |
| name: Run Tests in Backend | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v3 | |
| - name: Set up Go | |
| uses: actions/setup-go@v4 | |
| with: | |
| go-version: 1.23.4 # Use the same Go version as your local setup | |
| - name: Install dependencies | |
| run: | | |
| cd backend | |
| go mod tidy | |
| - name: Run tests in backend directory | |
| run: | | |
| cd backend | |
| go test ./... -v |