mirror of
https://github.com/xbgmsharp/postgsail.git
synced 2025-09-17 03:07:47 +00:00
52 lines
1.4 KiB
YAML
52 lines
1.4 KiB
YAML
name: Test PostgSail docker & schema
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- 'main'
|
|
# Allows you to run this workflow manually from the Actions tab
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
smoketest:
|
|
name: smoketest
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Check out the source
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Pull Docker image
|
|
run: docker pull xbgmsharp/timescaledb-postgis
|
|
|
|
- name: Install psql
|
|
run: sudo apt install postgresql-client
|
|
|
|
- name: Set env
|
|
run: cp .env.example .env
|
|
|
|
- name: Run PostgSail
|
|
# Environment variables
|
|
env:
|
|
# The hostname used to communicate with the PostgreSQL service container
|
|
PGHOST: localhost
|
|
PGPORT: 5432
|
|
PGDATABASE: signalk
|
|
PGUSER: username
|
|
PGPASSWORD: password
|
|
run: |
|
|
set -eu
|
|
source .env
|
|
docker-compose stop || true
|
|
docker-compose rm || true
|
|
docker-compose up -d db && sleep 15 && docker-compose up -d api && sleep 5
|
|
docker-compose ps -a
|
|
echo ${PGSAIL_API_URL}
|
|
curl ${PGSAIL_API_URL}
|
|
psql -c "select 1"
|
|
echo "Test PostgreSQL"
|
|
psql -c "SELECT version();"
|
|
psql -c "SELECT value is not null FROM app_settings WHERE name = 'app.version';"
|
|
- name: Show the logs
|
|
if: always()
|
|
run: |
|
|
docker-compose logs |