backend; did something stupid with my go.yml #523
This file contains 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 | |
on: | |
push: | |
branches: [ master ] | |
pull_request: | |
branches: [ master ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
services: | |
postgres: | |
image: pgvector/pgvector:pg16 | |
ports: | |
- 5432:5432 | |
env: | |
POSTGRES_USER: postgres | |
POSTGRES_PASSWORD: postgres | |
POSTGRES_DB: postgres | |
options: >- | |
--health-cmd "pg_isready -U postgres" | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Set up Go | |
uses: actions/setup-go@v3 | |
with: | |
go-version: '1.22' # Adjust this to your Go version | |
- name: Wait for PostgreSQL | |
run: | | |
until pg_isready -h localhost -p 5432; do | |
echo "Waiting for PostgreSQL to be ready..." | |
sleep 1 | |
done | |
- name: Create the database | |
run: | | |
psql postgresql://postgres:postgres@localhost:5432/postgres -c "CREATE DATABASE zettelkasten_testing;" | |
- name: Install dependencies | |
run: | | |
cd go-backend | |
go mod download | |
- name: Run tests | |
env: | |
DB_HOST: localhost | |
DB_PORT: 5432 | |
DB_USER: postgres | |
DB_PASS: postgres | |
DB_NAME: zettelkasten_testing | |
B2_ACCESS_KEY_ID: ${{ secrets.B2_ACCESS_KEY_ID }} | |
B2_SECRET_ACCESS_KEY: ${{ secrets.B2_SECRET_ACCESS_KEY }} | |
B2_BUCKET_NAME: ${{ secrets.B2_BUCKET_NAME }} | |
run: | | |
cd go-backend | |
go test ./handlers/ | |
go test ./llms/ |