2022-11-11 12:37:37 +01:00
|
|
|
name: Test Patches
|
|
|
|
on:
|
2024-11-01 01:02:07 -04:00
|
|
|
workflow_dispatch:
|
2025-02-09 01:46:08 +01:00
|
|
|
inputs:
|
|
|
|
discord_branch:
|
|
|
|
type: choice
|
|
|
|
description: "Discord Branch to test patches on"
|
|
|
|
options:
|
|
|
|
- both
|
|
|
|
- stable
|
|
|
|
- canary
|
|
|
|
default: both
|
2025-02-08 21:19:19 -05:00
|
|
|
schedule:
|
2025-02-09 01:46:08 +01:00
|
|
|
# # Every day at midnight
|
2025-02-08 21:19:19 -05:00
|
|
|
- cron: 0 0 * * *
|
2022-11-11 12:37:37 +01:00
|
|
|
|
|
|
|
jobs:
|
2024-11-01 01:02:07 -04:00
|
|
|
TestPlugins:
|
|
|
|
name: Test Patches
|
|
|
|
runs-on: ubuntu-latest
|
2024-04-17 14:29:47 -04:00
|
|
|
|
2024-11-01 01:02:07 -04:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v4
|
|
|
|
if: ${{ github.event_name == 'schedule' }}
|
|
|
|
with:
|
|
|
|
ref: dev
|
2024-04-17 14:29:47 -04:00
|
|
|
|
2024-11-01 01:02:07 -04:00
|
|
|
- uses: actions/checkout@v4
|
|
|
|
if: ${{ github.event_name == 'workflow_dispatch' }}
|
2024-04-17 14:29:47 -04:00
|
|
|
|
2024-11-01 11:23:16 -04:00
|
|
|
- uses: pnpm/action-setup@v3 # Install pnpm using packageManager key in package.json
|
2024-04-17 14:29:47 -04:00
|
|
|
|
2024-11-01 01:02:07 -04:00
|
|
|
- name: Use Node.js 20
|
|
|
|
uses: actions/setup-node@v4
|
|
|
|
with:
|
|
|
|
node-version: 20
|
|
|
|
cache: "pnpm"
|
2024-04-17 14:29:47 -04:00
|
|
|
|
2024-11-01 01:02:07 -04:00
|
|
|
- name: Install dependencies
|
|
|
|
run: |
|
|
|
|
pnpm install --frozen-lockfile
|
2024-04-17 14:29:47 -04:00
|
|
|
|
2024-11-01 01:02:07 -04:00
|
|
|
- name: Install Google Chrome
|
|
|
|
id: setup-chrome
|
|
|
|
uses: browser-actions/setup-chrome@82b9ce628cc5595478a9ebadc480958a36457dc2
|
|
|
|
with:
|
|
|
|
chrome-version: stable
|
2024-04-17 14:29:47 -04:00
|
|
|
|
2024-11-01 01:02:07 -04:00
|
|
|
- name: Build Equicord Reporter Version
|
|
|
|
run: pnpm buildReporter
|
2024-04-17 14:29:47 -04:00
|
|
|
|
2025-02-09 01:46:08 +01:00
|
|
|
- name: Run Reporter
|
2024-11-01 01:02:07 -04:00
|
|
|
timeout-minutes: 10
|
|
|
|
run: |
|
|
|
|
export PATH="$PWD/node_modules/.bin:$PATH"
|
|
|
|
export CHROMIUM_BIN=${{ steps.setup-chrome.outputs.chrome-path }}
|
2022-12-20 02:59:16 +01:00
|
|
|
|
2024-11-01 01:02:07 -04:00
|
|
|
esbuild scripts/generateReport.ts > dist/report.mjs
|
2024-04-17 14:29:47 -04:00
|
|
|
|
2025-02-09 01:46:08 +01:00
|
|
|
stable_output_file=$(mktemp)
|
|
|
|
canary_output_file=$(mktemp)
|
2024-04-17 14:29:47 -04:00
|
|
|
|
2025-02-09 01:46:08 +01:00
|
|
|
pids=""
|
|
|
|
|
|
|
|
branch="${{ inputs.discord_branch }}"
|
|
|
|
if [[ "${{ github.event_name }}" = "schedule" ]]; then
|
|
|
|
branch="both"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [[ "$branch" = "both" || "$branch" = "stable" ]]; then
|
|
|
|
node dist/report.mjs > "$stable_output_file" &
|
|
|
|
pids+=" $!"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [[ "$branch" = "both" || "$branch" = "canary" ]]; then
|
|
|
|
USE_CANARY=true node dist/report.mjs > "$canary_output_file" &
|
|
|
|
pids+=" $!"
|
|
|
|
fi
|
|
|
|
|
|
|
|
exit_code=0
|
|
|
|
for pid in $pids; do
|
|
|
|
if ! wait "$pid"; then
|
|
|
|
exit_code=1
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
cat "$stable_output_file" "$canary_output_file" >> $GITHUB_STEP_SUMMARY
|
|
|
|
exit $exit_code
|
2024-11-01 01:02:07 -04:00
|
|
|
env:
|
2025-02-08 21:14:05 -05:00
|
|
|
WEBHOOK_URL: ${{ secrets.WEBHOOK }}
|
2025-02-09 01:46:08 +01:00
|
|
|
WEBHOOK_SECRET: ${{ secrets.WEBHOOK_SECRET }}
|