Skip to content

chore: (api) api controller tests #9

chore: (api) api controller tests

chore: (api) api controller tests #9

Workflow file for this run

# This workflow will build a golang project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go
name: Build
on:
pull_request:
branches: [ "main" ]
jobs:
build-backend:
runs-on: ubuntu-latest
container: golang:1.23-bookworm
# Service containers to run with `container-job`
services:
# Label used to access the service container
postgres:
# Docker Hub image
image: postgres
# Provide the password for postgres
env:
POSTGRES_PASSWORD: postgres
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
defaults:
run:
working-directory: ./api
steps:
- uses: actions/checkout@v4
- name: Build
run: go build -v -buildvcs=false ./...
- name: Test
env:
DB_HOST: postgres
DB_NAME: postgres
DB_USER: postgres
DB_PASSWORD: postgres
INIT_JOBS: true
run: go test -v ./...
build-frontend:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./frontend
steps:
- uses: actions/checkout@v4
- name: Setup npm
uses: actions/setup-node@v4.1.0
with:
node-version: 18.8.x
- name: Install
run: npm install
- name: Build
run: npm run build
- name: Test
run: npm run test