WIP - let's check if the DB fails to start #17
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: CI | |
on: [push, pull_request] | |
jobs: | |
test: | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Test internal connectivity | |
run: | | |
docker compose up --wait db | |
docker compose run --rm -e PGPASSWORD="${POSTGRES_PASSWORD}" db psql --host db --username planwise --list || true | |
timeout 60s sh -c "while ! nc -z $(docker inspect planwise-db-1 | jq -r '.[0].NetworkSettings.Networks.planwise_default.IPAddress') 5432; do sleep 1; done" || true | |
docker inspect planwise-db-1 | |
docker compose run --rm -e PGPASSWORD="${POSTGRES_PASSWORD}" db psql --host db --username planwise --list || true | |
docker compose ps | |
docker compose logs db | |
exit 1 | |
- name: Set environment up | |
run: | | |
docker compose pull | |
docker compose build | |
docker compose run --rm client npm install | |
- name: Run specs | |
env: | |
JVM_OPTS: -Xmx3200m | |
run: | | |
docker compose up --wait db | |
docker compose run --rm -e JVM_OPTS app lein test | |
docker compose run --rm client npm run test | |
docker compose run --rm app lein check-format | |
build: | |
needs: test | |
runs-on: ubuntu-22.04 | |
env: | |
DOCKER_REPOSITORY: 'instedd/planwise' | |
DOCKER_USER: ${{ secrets.DOCKER_USER }} | |
DOCKER_PASS: ${{ secrets.DOCKER_PASS }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Build image & push to Docker Hub | |
run: ./build.sh |