This repository was archived by the owner on Nov 23, 2025. It is now read-only.
fix: Update CORS configuration to allow requests from 127.0.0.1 #16
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: Build and Test API Gateway | |
| on: | |
| push: | |
| branches: | |
| - '**' | |
| pull_request: | |
| branches: | |
| - '**' | |
| jobs: | |
| build-test: | |
| name: Build and Start Check | |
| 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' | |
| cache-dependency-path: go.mod | |
| - name: Download dependencies | |
| run: go mod download | |
| - name: Build Go Application | |
| run: go build -v -o ./app ./cmd/gateway | |
| - name: Verify config.yaml exists | |
| run: | | |
| if [ ! -f config.yaml ]; then | |
| echo "Error: config.yaml not found!" | |
| exit 1 | |
| fi | |
| echo "✓ config.yaml found" | |
| - name: Start Gateway (smoke test) | |
| run: | | |
| echo "Starting API Gateway with config.yaml..." | |
| timeout 5s ./app || code=$? | |
| if [ ${code:-0} -eq 124 ]; then | |
| echo "✓ Gateway started successfully (terminated after 5s)" | |
| exit 0 | |
| elif [ ${code:-0} -eq 0 ]; then | |
| echo "✓ Gateway started and stopped cleanly" | |
| exit 0 | |
| else | |
| echo "✗ Gateway failed to start (exit code: ${code})" | |
| exit 1 | |
| fi | |
| - name: Upload Build Artifact | |
| if: success() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: api-gateway-binary | |
| path: app |