Skip to content

feat: stacked APY rewards -- LF-17256 #6064

feat: stacked APY rewards -- LF-17256

feat: stacked APY rewards -- LF-17256 #6064

Workflow file for this run

name: Playwright Tests
on:
- pull_request
- workflow_dispatch
permissions:
checks: write
pull-requests: write
contents: write
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
create-qase-run:
name: Create Qase Run
runs-on: ubuntu-latest
continue-on-error: true
timeout-minutes: 3
outputs:
run_id: ${{ steps.create-run.outputs.run_id }}
public_link: ${{ steps.create-public-link.outputs.public_link }}
steps:
- name: Create Qase Test Run
id: create-run
run: |
if [ -z "${{ secrets.QASE_TOKEN }}" ]; then
echo "No Qase API token available, skipping Qase run creation"
exit 0
fi
RUN_TITLE="[Jumper Exchange] CI Run ${{ github.run_id }}"
if [ "${{ github.event_name }}" = "pull_request" ]; then
PR_URL="${{ github.event.pull_request.html_url }}"
DESCRIPTION="Pull Request: [$PR_URL]($PR_URL)"
else
DESCRIPTION=""
fi
data=$(jq -n \
--arg title "$RUN_TITLE" \
--arg description "$DESCRIPTION" \
'{title: $title, description: $description}')
response=$(curl --silent --fail --show-error --request POST \
--url https://api.qase.io/v1/run/WJ \
--header "Token: ${{ secrets.QASE_TOKEN }}" \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data "$data")
run_id=$(echo "$response" | jq -r '.result.id')
echo "run_id=$run_id" >> "$GITHUB_OUTPUT"
echo "Qase API Response: $response"
echo "Extracted Run ID: $run_id"
- name: Create public link to run
id: create-public-link
run: |
public_link=$(curl --silent --fail --show-error --request PATCH \
--url "https://api.qase.io/v1/run/WJ/${{ steps.create-run.outputs.run_id }}/public" \
--header "Token: ${{ secrets.QASE_TOKEN }}" \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data '{"status":true}' \
| jq -r '.result.url')
echo "public_link=$public_link" >> "$GITHUB_OUTPUT"
echo "Public link: $public_link"
test:
needs: [create-qase-run]
name: Test (${{ matrix.shard }} / ${{ strategy.job-total}})
continue-on-error: false # Instead we use fail-fast to forward the failure state to subsequent jobs
timeout-minutes: 20
runs-on: ubuntu-latest
strategy:
matrix:
shard: [1, 2, 3, 4, 5, 6]
fail-fast: false
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0
- uses: actions/setup-node@v4
with:
node-version: 20
cache: "pnpm"
- name: Install pnpm
run: npm install -g pnpm
- name: Install dependencies
run: pnpm install
- name: Install Playwright Browsers
run: |
pnpm exec playwright install --with-deps chromium
- name: Run Playwright tests
env:
QASE_TESTOPS_RUN_ID: ${{ needs.create-qase-run.outputs.run_id || '' }}
QASE_TESTOPS_API_TOKEN: ${{ secrets.QASE_TOKEN }}
if: ${{ !cancelled()}} # Always attempt to run the tests even if cache setup failed
run: |
if [ -n "${{ secrets.QASE_TOKEN }}" ] && [ -n "$QASE_TESTOPS_RUN_ID" ]; then
echo "Running tests with Qase reporting (Run ID: $QASE_TESTOPS_RUN_ID)"
pnpm run test:ci:e2e:qase \
--shard ${{ matrix.shard }}/${{ strategy.job-total }}
else
echo "Running tests without Qase reporting (API token or run ID not available)"
pnpm run test:ci:e2e \
--shard ${{ matrix.shard }}/${{ strategy.job-total }}
fi
- name: Upload blob report to Github Actions Artifacts
if: ${{ !cancelled() }}
uses: actions/upload-artifact@v4
with:
name: blob-report-${{ matrix.shard }}
path: blob-report
retention-days: 1
merge-reports:
if: ${{ !cancelled() }}
needs: [test]
timeout-minutes: 3
outputs:
summary: ${{ steps.summary.outputs.summary }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0
- uses: actions/setup-node@v4
with:
node-version: 20
cache: "pnpm"
- name: Install dependencies
run: pnpm install
- name: Download blob reports from GitHub Actions Articfacts
uses: actions/download-artifact@v4
with:
path: all-blob-reports
pattern: blob-report-*
merge-multiple: true
- name: Merge into HTML and JSON Reports
run: npx playwright merge-reports --reporter=html,json ./all-blob-reports
env:
PLAYWRIGHT_JSON_OUTPUT_NAME: report.json
- uses: daun/playwright-report-summary@be9e270edd5ad86038604d3caa84a819a6ff6fed # v3.10.0
id: summary
with:
report-file: ./report.json
create-comment: false
- name: Upload HTML report
uses: actions/upload-artifact@v4
with:
name: html-report--attempt-${{ github.run_attempt }}
path: playwright-report
retention-days: 2
post-comment:
needs: [create-qase-run, merge-reports]
if: ${{ !cancelled() && github.event_name == 'pull_request' }}
runs-on: ubuntu-latest
steps:
- uses: marocchino/sticky-pull-request-comment@v2
with:
message: |
${{ needs.merge-reports.outputs.summary }}
${{ needs.create-qase-run.outputs.public_link != '' && needs.create-qase-run.outputs.public_link != null && format('📋 [View Detailed Qase Report]({0})', needs.create-qase-run.outputs.public_link) || '' }}