Use Viper for configs #33
Workflow file for this run
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: test | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
permissions: | |
contents: read | |
jobs: | |
test: | |
name: test | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-go@v5 | |
with: | |
go-version: '1.23' | |
- name: Install pnpm | |
uses: pnpm/action-setup@v3 | |
with: | |
version: 9 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: '20.10.0' | |
cache: 'pnpm' | |
cache-dependency-path: client/pnpm-lock.yaml | |
- name: Spin up docker-compose | |
run: | | |
cp .env.quizory.example .env.quizory | |
make dev | |
- name: Wait for service to be healthy | |
run: | | |
echo "Waiting for service to be healthy..." | |
timeout=60 # Total time to wait in seconds | |
interval=2 # Time between checks in seconds | |
elapsed=0 | |
until curl -s -o /dev/null -w "%{http_code}" http://localhost:8080/health-check | grep -q "200"; do | |
if [ $elapsed -ge $timeout ]; then | |
echo "Service did not become healthy after $timeout seconds." | |
exit 1 | |
fi | |
echo "Service not healthy yet. Waiting..." | |
sleep $interval | |
elapsed=$((elapsed + interval)) | |
done | |
echo "Service is healthy." | |
- name: Output service logs on failure | |
if: failure() | |
run: docker compose logs | |
- name: Check for dirty git | |
run: | | |
make install | |
make migrate | |
make codegen | |
git diff --exit-code | |
- name: Build | |
run: make build | |
- name: Test | |
run: make test |