Skip to content

Commit

Permalink
Update CI
Browse files Browse the repository at this point in the history
  • Loading branch information
rolljee committed Nov 6, 2024
1 parent a7ffac3 commit f60b3c9
Showing 1 changed file with 33 additions and 3 deletions.
36 changes: 33 additions & 3 deletions .github/workflows/pull_request.workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,46 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'npm'

- name: Install dependencies
run: npm ci

- name: Build
run: npm run build

- name: Start Kuzzle
run: docker compose up --wait

- name: Start preview server
run: npm run preview &
env:
PORT: 8080

- name: Wait for preview server
run: |
timeout=30
while ! nc -z localhost 8080; do
if [ $timeout -le 0 ]; then
echo "Timeout waiting for preview server"
exit 1
fi
timeout=$((timeout-1))
sleep 1
done
- name: Cypress run
uses: cypress-io/github-action@v6
with:
build: npm run build
start: npm run preview
browser: chrome
spec: test/e2e/cypress/integration/single-backend/${{ matrix.spec }}
spec: e2e/cypress/integration/single-backend/${{ matrix.spec }}
install: false # Skip installation as we already did npm ci
wait-on: 'http://localhost:8080'
wait-on-timeout: 60

- name: Upload screenshots
uses: actions/upload-artifact@v4
Expand Down

0 comments on commit f60b3c9

Please sign in to comment.