mirror of
https://github.com/zoriya/Kyoo.git
synced 2026-05-24 08:02:26 -04:00
Add healthcheck for auth (#658)
This commit is contained in:
@@ -1,52 +0,0 @@
|
||||
name: RobotTests
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
- next
|
||||
pull_request:
|
||||
|
||||
|
||||
jobs:
|
||||
test:
|
||||
name: Run Robot Tests
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Robot cache
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: '3.9'
|
||||
cache: 'pip'
|
||||
|
||||
- run: pip install -r requirements.txt
|
||||
|
||||
- name: Docker cache
|
||||
uses: satackey/action-docker-layer-caching@v0.0.11
|
||||
continue-on-error: true
|
||||
|
||||
- name: Start the service
|
||||
run: |
|
||||
cp .env.example .env
|
||||
docker compose --profile v5 -f docker-compose.build.yml up -d auth postgres traefik --wait --build
|
||||
|
||||
- name: Perform healthchecks
|
||||
run: |
|
||||
docker compose ps -a
|
||||
docker compose logs
|
||||
# wget --retry-connrefused --retry-on-http-error=502 http://localhost:8901/api/health || (docker compose logs && exit 1)
|
||||
|
||||
- name: Run robot tests
|
||||
run: |
|
||||
robot -d out $(find -type d -name robot)
|
||||
|
||||
- name: Show logs
|
||||
if: failure()
|
||||
run: docker compose logs
|
||||
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: results
|
||||
path: out
|
||||
|
||||
@@ -0,0 +1,74 @@
|
||||
name: RobotTests
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
- next
|
||||
pull_request:
|
||||
|
||||
|
||||
jobs:
|
||||
test:
|
||||
name: Robot tests Auth
|
||||
runs-on: ubuntu-latest
|
||||
services:
|
||||
postgres:
|
||||
image: postgres:15
|
||||
ports:
|
||||
- "5432:5432"
|
||||
env:
|
||||
POSTGRES_USER: kyoo
|
||||
POSTGRES_PASSWORD: password
|
||||
options: >-
|
||||
--health-cmd pg_isready
|
||||
--health-interval 10s
|
||||
--health-timeout 5s
|
||||
--health-retries 5
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Robot cache
|
||||
uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: '3.9'
|
||||
cache: 'pip'
|
||||
|
||||
- run: pip install -r requirements.txt
|
||||
|
||||
- uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version: '^1.22.5'
|
||||
cache-dependency-path: ./auth/go.sum
|
||||
|
||||
- name: Install dependencies
|
||||
working-directory: ./auth
|
||||
run: |
|
||||
go mod download
|
||||
go install github.com/sqlc-dev/sqlc/cmd/sqlc@latest
|
||||
go install github.com/swaggo/swag/cmd/swag@latest
|
||||
|
||||
- name: Build
|
||||
working-directory: ./auth
|
||||
run: |
|
||||
sqlc generate
|
||||
swag init --parseDependency
|
||||
go build -o ./keibi
|
||||
|
||||
- name: Run robot tests
|
||||
working-directory: ./auth
|
||||
run: |
|
||||
./keibi > logs &
|
||||
wget --retry-connrefused --retry-on-http-error=502 http://localhost:4568/health
|
||||
robot -d out robot
|
||||
env:
|
||||
POSTGRES_SERVER: localhost
|
||||
|
||||
- name: Show logs
|
||||
working-directory: ./auth
|
||||
run: cat logs
|
||||
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: results
|
||||
path: auth/out
|
||||
|
||||
Reference in New Issue
Block a user