Manual/Periodic Tests #21
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: Manual/Periodic Tests | |
env: | |
CI: true | |
FORCE_COLOR: 1 | |
PLAYWRIGHT_BROWSERS_PATH: ${{ github.workspace }}/ms-playwright | |
on: | |
schedule: | |
- cron: '15 * * * *' | |
workflow_dispatch: | |
inputs: | |
metamask-tag: | |
description: 'Metamask tag to download. ie. "v10.27.0"' | |
metamask-seed: | |
description: 'Seed to use for Metamask' | |
metamask-password: | |
description: 'Password to use for Metamask' | |
metamask-snap-id: | |
description: 'Snap ID to install in Metamask. ie. "npm:filsnap"' | |
metamask-snap-version: | |
description: 'Snap Version to install Metamask' | |
jobs: | |
test: | |
timeout-minutes: 60 | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: pnpm/[email protected] | |
with: | |
version: 8 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
cache: 'pnpm' | |
- run: pnpm install | |
- run: pnpm dlx playwright install --with-deps chromium | |
- run: echo "${{ github.event_name}}" | |
- run: pnpm -r --filter filsnap run test | |
id: tests | |
env: | |
GITHUB_TOKEN: ${{ github.token }} | |
METAMASK_TAG: ${{ inputs.metamask-tag }} | |
METAMASK_MNEMONIC: ${{ inputs.metamask-seed }} | |
METAMASK_PASSWORD: ${{ inputs.metamask-password }} | |
METAMASK_SNAP_ID: ${{ inputs.metamask-snap-id }} | |
METAMASK_SNAP_VERSION: ${{ inputs.metamask-snap-version }} | |
- uses: actions/upload-artifact@v3 | |
if: always() | |
with: | |
name: playwright-report | |
path: packages/testing/playwright-report/ | |
retention-days: 30 | |
- name: Check for playwright-report | |
id: check_report | |
if: always() | |
uses: andstor/file-existence-action@v2 | |
with: | |
files: packages/testing/playwright-report | |
- name: Add report to web3.storage | |
if: always() && steps.check_report.outputs.files_exists == 'true' && steps.tests.outcome != 'success' | |
uses: web3-storage/add-to-web3@v2 | |
id: add_to_web3_storage | |
with: | |
path_to_add: packages/testing/playwright-report | |
web3_token: ${{ secrets.WEB3_TOKEN }} | |
- name: Add url to GITHUB_STEP_SUMMARY | |
if: always() && steps.check_report.outputs.files_exists == 'true' && steps.tests.outcome != 'success' | |
run: | | |
echo " | |
### Snap Tests failed 🤷🏻♂️ | |
Check report and traces: https://w3s.link/ipfs/${{ steps.add_to_web3_storage.outputs.cid }} | |
" >> $GITHUB_STEP_SUMMARY | |
- name: Notify Slack | |
if: always() && github.event_name == 'schedule' && steps.check_report.outputs.files_exists == 'true' && steps.tests.outcome != 'success' | |
run: echo "Slack notification" | |
# uses: ravsamhq/notify-slack-action@v2 | |
# with: | |
# status: ${{ job.status }} | |
# notify_when: 'failure' | |
# token: ${{ secrets.GITHUB_TOKEN }} | |
# notification_title: 'Filsnap tests {status_message}!' | |
# message_format: '{emoji} *<{workflow_url}|{workflow}>* workflow {status_message} in the <{run_url}|{job}> job.' | |
# footer: '<{repo_url}|{repo}>' | |
# env: | |
# SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }} |