.github/workflows/build.yml

Summary

Maintainability
Test Coverage
name: Go
on: [push]

jobs:
  build-back:
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v3
      - name: Setup Go
        uses: actions/setup-go@v4
        with:
          go-version: '1.20.x'
          cache-dependency-path: backend/go.sum
      - name: Install backend dependencies
        run: cd backend && go mod download
      - name: Build Go binary
        run: cd backend && go build -v ./...
      - name: Test with the Go CLI
        run: cd backend && go test ./...

  build-front:
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v3
      - name: Install Node.js
        uses: actions/setup-node@v2
        with:
          node-version: '20'
          cache: 'npm'
          cache-dependency-path: frontend/package-lock.json
      - name: Install front dependencies
        run: cd frontend && npm install
      - name: Build front
        run: cd frontend && npm run build