Skip to content
This repository was archived by the owner on Nov 23, 2025. It is now read-only.

feat: Add GitHub Actions workflow for building and testing API Gateway #1

feat: Add GitHub Actions workflow for building and testing API Gateway

feat: Add GitHub Actions workflow for building and testing API Gateway #1

Workflow file for this run

name: Build and Test API Gateway
on:
push:
branches:
- '**'
pull_request:
branches:
- '**'
jobs:
build-test:
name: Install, Build and Test
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: Cache Go modules
uses: actions/cache@v4
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Download dependencies
run: go mod download
- name: Run Go Tests
run: go test -v -race -coverprofile=coverage.out ./...
- name: Build Go Application
run: go build -v -o ./app ./cmd/gateway
- name: Upload Test Coverage
if: always()
uses: actions/upload-artifact@v4
with:
name: api-gateway-coverage
path: coverage.out
- name: Upload Build Artifact
if: success()
uses: actions/upload-artifact@v4
with:
name: api-gateway-binary
path: app