-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rework action to obtain URL as artifact
- Loading branch information
Showing
2 changed files
with
48 additions
and
3 deletions.
There are no files selected for viewing
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
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) |
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
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 |