Update github workflows

This commit is contained in:
xbgmsharp
2023-07-12 17:21:58 +02:00
parent c056737e2f
commit 582cd4460e
3 changed files with 59 additions and 20 deletions

52
.github/workflows/frontend-test.yml vendored Normal file
View File

@@ -0,0 +1,52 @@
name: Test services db api web
on:
pull_request:
paths:
- 'frontend/**'
branches:
- 'main'
push:
branches:
- 'main'
paths:
- 'frontend/**'
workflow_dispatch:
jobs:
ci-test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Pull Docker images
run: docker-compose pull db api web
- name: Set env
run: cp .env.example .env
- name: Run PostgSail Grafana test
# 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 "Test PostgSail Web Unit Test"
docker-compose -d up web && sleep 5
docker-compose ps -a
curl http://localhost:8080/
- name: Show the logs
if: always()
run: |
docker-compose logs