Kyoo/.github/workflows/auth-hurl.yml
2025-04-23 22:35:52 +02:00

65 lines
1.5 KiB
YAML

name: HurlTests
on:
push:
branches:
- master
- next
pull_request:
jobs:
test:
name: Hurl 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
- uses: gacts/install-hurl@v1
- 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
- name: Build
working-directory: ./auth
run: |
go build -o ./keibi
- name: Run hurl tests
working-directory: ./auth
run: |
./keibi > logs &
wget --retry-connrefused --retry-on-http-error=502 http://localhost:4568/health
hurl --error-format long --variable host=http://localhost:4568 tests/*
env:
POSTGRES_SERVER: localhost
FIRST_USER_CLAIMS: '{"permissions": ["users.read"]}'
KEIBI_APIKEY_HURL: 1234apikey
KEIBI_APIKEY_HURL_CLAIMS: '{"permissions": ["apikeys.write", "apikeys.read"]}'
- name: Show logs
if: failure()
working-directory: ./auth
run: cat logs