mirror of
https://github.com/zitadel/zitadel.git
synced 2025-12-12 06:02:23 +00:00
50 lines
1.6 KiB
YAML
50 lines
1.6 KiB
YAML
name: Acceptance Tests
|
|
on: pull_request
|
|
jobs:
|
|
acceptance-tests:
|
|
timeout-minutes: 60
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: actions/setup-node@v4
|
|
with:
|
|
node-version: lts/*
|
|
- name: Run Docker Compose and Install Dependencies in Parallel
|
|
run: |
|
|
echo "Start docker-compose in the background"
|
|
docker compose -f ./acceptance/docker-compose.yaml up -d &
|
|
DOCKER_COMPOSE_PID=$!
|
|
|
|
echo "Install node_modules in the foreground"
|
|
npm install -g pnpm && pnpm install
|
|
|
|
echo "Generate and create a production build in the background"
|
|
pnpm build &
|
|
GENERATE_BUILD_PID=$!
|
|
|
|
echo "Install Playwright with browsers in the background"
|
|
pnpm exec playwright install --with-deps &
|
|
PLAYWRIGHT_INSTALL_PID=$!
|
|
|
|
echo "Wait for all background processes to complete"
|
|
while true; do
|
|
wait -n $DOCKER_COMPOSE_PID $GENERATE_BUILD_PID $PLAYWRIGHT_INSTALL_PID
|
|
EXIT_STATUS=$?
|
|
if [ $EXIT_STATUS -ne 0 ]; then
|
|
echo "A background process failed with exit code $EXIT_STATUS."
|
|
exit $EXIT_STATUS
|
|
fi
|
|
# Exit the loop if all processes have finished
|
|
if ! kill -0 $DOCKER_COMPOSE_PID $GENERATE_BUILD_PID $PLAYWRIGHT_INSTALL_PID 2>/dev/null; then
|
|
break
|
|
fi
|
|
done
|
|
- name: Run Playwright Tests
|
|
run: pnpm exec playwright test
|
|
- uses: actions/upload-artifact@v4
|
|
if: ${{ !cancelled() }}
|
|
with:
|
|
name: playwright-report
|
|
path: playwright-report/
|
|
retention-days: 30
|