[JN-1139] Portal dashboard redesign #723
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: End-to-end tests | |
on: | |
push: | |
branches: | |
- development | |
pull_request: | |
branches: | |
- development | |
jobs: | |
test: | |
timeout-minutes: 60 | |
runs-on: ubuntu-latest | |
services: | |
postgres: | |
image: postgres | |
env: | |
POSTGRES_PASSWORD: dbpwd | |
POSTGRES_USER: dbuser | |
POSTGRES_DB: pearl | |
options: >- | |
--health-cmd pg_isready | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
ports: | |
- 5432:5432 | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-java@v3 | |
with: | |
java-version: '21' | |
distribution: 'adopt' | |
- name: Setup Gradle | |
uses: gradle/gradle-build-action@v2 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 16 | |
- name: Install dependencies | |
run: npm ci | |
- name: Build applications | |
run: | | |
./scripts/run_dockerized.sh participant | |
./scripts/run_dockerized.sh admin | |
- name: Wait for applications to start | |
run: | | |
for i in {1..30}; do | |
participant_status=$(curl -s http://localhost:8080/status | jq -r '.ok') | |
admin_status=$(curl -s http://localhost:8081/status | jq -r '.ok') | |
if [ "$participant_status" == "true" ] && [ "$admin_status" == "true" ]; then | |
echo "Applications are ready" | |
break | |
fi | |
echo "Waiting for applications to start..." | |
sleep 10 | |
done | |
if [ "$participant_status" != "true" ] || [ "$admin_status" != "true" ]; then | |
echo "Application start timed out after 5 minutes" | |
exit 1 | |
fi | |
- name: Install Playwright Browsers | |
run: npx playwright install --with-deps | |
- name: Run Playwright tests | |
run: npm -w e2e-tests test | |
- name: Upload test results | |
if: always() | |
uses: actions/upload-artifact@v4 | |
with: | |
name: test-results | |
path: | | |
e2e-tests/playwright-report/** | |
e2e-tests/test-results/** | |
- name: Notify slack on failure | |
uses: broadinstitute/[email protected] | |
if: failure() && github.ref == 'refs/heads/development' | |
env: | |
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} | |
with: | |
channel: '#juniper-dev-notifications' | |
status: failure | |
author_name: End-to-end failed on merge to development | |
fields: job | |
text: "End-to-end tests failed :sadpanda:" | |
username: 'Juniper Build Notifications' |