2022-11-11 12:37:37 +01:00
name : Test Patches
on :
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
webhook_url :
type : string
description : "Webhook URL that the report will be posted to. This will be visible for everyone, so DO NOT pass sensitive webhooks like discord webhook. This is meant to be used by Venbot."
required : false
# schedule:
# # Every day at midnight
# - cron: 0 0 * * *
2022-11-11 12:37:37 +01:00
jobs :
TestPlugins :
2023-06-09 19:48:18 +00:00
if : github.repository == 'Vendicated/Vencord'
2022-11-11 12:37:37 +01:00
runs-on : ubuntu-latest
steps :
2024-05-03 18:47:15 -03:00
- uses : actions/checkout@v4
2023-11-25 01:56:29 +01:00
if : ${{ github.event_name == 'schedule' }}
with :
ref : dev
2024-05-03 18:47:15 -03:00
- uses : actions/checkout@v4
2023-11-25 01:56:29 +01:00
if : ${{ github.event_name == 'workflow_dispatch' }}
2022-11-11 12:37:37 +01:00
2024-05-03 18:47:15 -03:00
- uses : pnpm/action-setup@v3 # Install pnpm using packageManager key in package.json
2022-11-11 12:37:37 +01:00
2024-05-07 04:54:25 +02:00
- name : Use Node.js 20
2024-05-03 18:47:15 -03:00
uses : actions/setup-node@v4
2022-11-11 12:37:37 +01:00
with :
2024-05-07 04:54:25 +02:00
node-version : 20
2022-11-11 12:37:37 +01:00
cache : "pnpm"
- name : Install dependencies
run : |
2023-06-01 22:49:15 +02:00
pnpm install --frozen-lockfile
2022-11-11 12:37:37 +01:00
2024-05-03 18:47:15 -03:00
- name : Install Google Chrome
id : setup-chrome
uses : browser-actions/setup-chrome@82b9ce628cc5595478a9ebadc480958a36457dc2
with :
2024-05-07 04:54:25 +02:00
chrome-version : stable
2022-11-11 13:06:04 +01:00
2024-05-29 06:45:44 -03:00
- name : Build Vencord Reporter Version
run : pnpm buildReporter
2022-11-11 12:37:37 +01:00
2025-02-09 01:46:08 +01:00
- name : Run Reporter
2022-11-11 13:06:04 +01:00
timeout-minutes : 10
2022-11-11 12:37:37 +01:00
run : |
2023-06-01 22:49:15 +02:00
export PATH="$PWD/node_modules/.bin:$PATH"
2024-05-03 18:47:15 -03:00
export CHROMIUM_BIN=${{ steps.setup-chrome.outputs.chrome-path }}
2022-11-11 13:06:04 +01:00
2023-06-01 22:49:15 +02:00
esbuild scripts/generateReport.ts > dist/report.mjs
2022-12-20 02:59:16 +01:00
2025-02-09 01:46:08 +01:00
stable_output_file=$(mktemp)
canary_output_file=$(mktemp)
2022-12-20 02:59:16 +01: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
2022-12-20 02:59:16 +01:00
env :
2025-02-09 01:46:08 +01:00
WEBHOOK_URL : ${{ inputs.webhook_url || secrets.DISCORD_WEBHOOK }}
WEBHOOK_SECRET : ${{ secrets.WEBHOOK_SECRET }}