Skip to content

Commit

Permalink
change ci
Browse files Browse the repository at this point in the history
  • Loading branch information
Sergio Beltrán committed Jun 3, 2024
1 parent befd1e7 commit 35ba991
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 43 deletions.
8 changes: 1 addition & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
name: CI

on:
push:
branches:
- main
pull_request:
branches:
- main
on: [push, pull_request]

jobs:
build-and-test:
Expand Down
67 changes: 31 additions & 36 deletions .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
@@ -1,37 +1,12 @@
name: CI
name: Playwright Tests

on:
push:
branches:
- main
pull_request:
branches:
- main
on: [push, pull_request]

jobs:
build-and-test:
build:
runs-on: ubuntu-latest

services:
docker:
image: docker:19.03.12
options: --privileged
ports:
- 5000:5000
- 9099:9099
- 5001:5001
- 8081:8081
- 5002:5002
- 9199:9199
- 4000:4000
- 4400:4400
- 4500:4500
- 9150:9150
- 5007:5007

steps:
- name: Checkout code
uses: actions/checkout@v2
- uses: actions/checkout@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
Expand All @@ -44,12 +19,32 @@ jobs:
restore-keys: |
${{ runner.os }}-buildx-
- name: Build and run Docker Compose
run: docker-compose -f docker-compose.yml up --abort-on-container-exit --exit-code-from test
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '18.x'

- name: Check Docker Compose Test Result
- name: Build and start services
run: docker-compose up -d --build

- name: Wait for services to be ready
run: |
EXIT_CODE=$(docker inspect test --format='{{.State.ExitCode}}')
if [ "$EXIT_CODE" -ne 0 ]; then
exit $EXIT_CODE
fi
while ! nc -z localhost 5000; do sleep 10; done
while ! nc -z localhost 4000; do sleep 10; done
- name: Run Playwright tests
run: |
npm ci
npx playwright install --with-deps chromium
npx playwright test
- name: Upload Playwright report
uses: actions/upload-artifact@v2
if: ${{ !cancelled() }}
with:
name: playwright-report
path: playwright-report/
retention-days: 30

- name: Stop services
run: docker-compose down

0 comments on commit 35ba991

Please sign in to comment.