|
1 | 1 | name: Test Patches
|
2 | 2 | on:
|
3 | 3 | workflow_dispatch:
|
4 |
| - schedule: |
5 |
| - # Every day at midnight |
6 |
| - - cron: 0 0 * * * |
| 4 | + inputs: |
| 5 | + discord_branch: |
| 6 | + type: choice |
| 7 | + description: "Discord Branch to test patches on" |
| 8 | + options: |
| 9 | + - both |
| 10 | + - stable |
| 11 | + - canary |
| 12 | + default: both |
| 13 | + webhook_url: |
| 14 | + type: string |
| 15 | + 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." |
| 16 | + required: false |
| 17 | + # schedule: |
| 18 | + # # Every day at midnight |
| 19 | + # - cron: 0 0 * * * |
7 | 20 |
|
8 | 21 | jobs:
|
9 | 22 | TestPlugins:
|
@@ -40,28 +53,43 @@ jobs:
|
40 | 53 | - name: Build Vencord Reporter Version
|
41 | 54 | run: pnpm buildReporter
|
42 | 55 |
|
43 |
| - - name: Create Report |
| 56 | + - name: Run Reporter |
44 | 57 | timeout-minutes: 10
|
45 | 58 | run: |
|
46 | 59 | export PATH="$PWD/node_modules/.bin:$PATH"
|
47 | 60 | export CHROMIUM_BIN=${{ steps.setup-chrome.outputs.chrome-path }}
|
48 | 61 |
|
49 | 62 | esbuild scripts/generateReport.ts > dist/report.mjs
|
50 |
| - node dist/report.mjs >> $GITHUB_STEP_SUMMARY |
51 |
| - env: |
52 |
| - DISCORD_TOKEN: ${{ secrets.DISCORD_TOKEN }} |
53 |
| - DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }} |
54 | 63 |
|
55 |
| - - name: Create Report (Canary) |
56 |
| - timeout-minutes: 10 |
57 |
| - if: success() || failure() # even run if previous one failed |
58 |
| - run: | |
59 |
| - export PATH="$PWD/node_modules/.bin:$PATH" |
60 |
| - export CHROMIUM_BIN=${{ steps.setup-chrome.outputs.chrome-path }} |
61 |
| - export USE_CANARY=true |
| 64 | + stable_output_file=$(mktemp) |
| 65 | + canary_output_file=$(mktemp) |
62 | 66 |
|
63 |
| - esbuild scripts/generateReport.ts > dist/report.mjs |
64 |
| - node dist/report.mjs >> $GITHUB_STEP_SUMMARY |
| 67 | + pids="" |
| 68 | +
|
| 69 | + branch="${{ inputs.discord_branch }}" |
| 70 | + if [[ "${{ github.event_name }}" = "schedule" ]]; then |
| 71 | + branch="both" |
| 72 | + fi |
| 73 | +
|
| 74 | + if [[ "$branch" = "both" || "$branch" = "stable" ]]; then |
| 75 | + node dist/report.mjs > "$stable_output_file" & |
| 76 | + pids+=" $!" |
| 77 | + fi |
| 78 | +
|
| 79 | + if [[ "$branch" = "both" || "$branch" = "canary" ]]; then |
| 80 | + USE_CANARY=true node dist/report.mjs > "$canary_output_file" & |
| 81 | + pids+=" $!" |
| 82 | + fi |
| 83 | +
|
| 84 | + exit_code=0 |
| 85 | + for pid in $pids; do |
| 86 | + if ! wait "$pid"; then |
| 87 | + exit_code=1 |
| 88 | + fi |
| 89 | + done |
| 90 | +
|
| 91 | + cat "$stable_output_file" "$canary_output_file" >> $GITHUB_STEP_SUMMARY |
| 92 | + exit $exit_code |
65 | 93 | env:
|
66 |
| - DISCORD_TOKEN: ${{ secrets.DISCORD_TOKEN }} |
67 |
| - DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }} |
| 94 | + WEBHOOK_URL: ${{ inputs.webhook_url || secrets.DISCORD_WEBHOOK }} |
| 95 | + WEBHOOK_SECRET: ${{ secrets.WEBHOOK_SECRET }} |
0 commit comments