Skip to content

Commit

Permalink
Rework action to obtain URL as artifact
Browse files Browse the repository at this point in the history
  • Loading branch information
benefacto committed Dec 27, 2023
1 parent 1a121ca commit 7f6cda1
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 3 deletions.
17 changes: 14 additions & 3 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -1,23 +1,34 @@
name: Playwright Tests

on:
deployment_status:
workflow_run:
workflows: ["Upload Deployment URL"]
types:
- completed

jobs:
test:
needs: capture-deployment-url
if: github.event_name != 'deployment_status'
timeout-minutes: 60
runs-on: ubuntu-latest
if: github.event.deployment_status.state == 'success'
steps:
- uses: actions/checkout@v4
with:
repository: W3DevTeam/TezosHomebaseTests
- uses: actions/setup-node@v4
with:
node-version: 18
- name: Download Deployment URL
uses: actions/download-artifact@v2
with:
name: deployment-url
- run: echo "$(<deployment-url)"
- name: Install dependencies
run: npm ci
- name: Install Playwright
run: npx playwright install --with-deps
- name: Run Playwright tests
run: npx playwright test
env:
PLAYWRIGHT_TEST_BASE_URL: ${{ github.event.deployment_status.target_url }}
WEBAPP_URL: $(cat deployment-url | grep DEPLOYMENT_URL | cut -d '=' -f2)
34 changes: 34 additions & 0 deletions .github/workflows/upload_deployment_url.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Upload Deployment URL

on:
push:
branches:
# Uncomment below before merging
# - master
# - staging
# - develop
# All branches just for testing (remove before merging)
- '**'
pull_request:
branches:
# Uncomment below before merging
# - master
# - staging
# - develop
# All branches just for testing (remove before merging)
- '**'
deployment_status:

jobs:
capture-deployment-url:
if: github.event_name == 'deployment_status' && github.event.deployment_status.state == 'success'
runs-on: ubuntu-latest
steps:
- name: Capture Deployment URL
run: |
echo "DEPLOYMENT_URL=${{ github.event.deployment_status.target_url }}" >> $GITHUB_ENV
- name: Save Deployment URL
uses: actions/upload-artifact@v4
with:
name: deployment-url
path: $GITHUB_ENV

0 comments on commit 7f6cda1

Please sign in to comment.