diff options
author | Vendicated <vendicated@riseup.net> | 2022-12-20 02:59:16 +0100 |
---|---|---|
committer | Vendicated <vendicated@riseup.net> | 2022-12-20 02:59:16 +0100 |
commit | 0743c1215e539765cf4ea90a690ccdbab8a2cb55 (patch) | |
tree | a8dfd3ebe750b2b64f65bb1475e45da3b4fb8924 | |
parent | 94ad8e8f61abb3c6256f9caa39878150b326790f (diff) | |
download | Vencord-0743c1215e539765cf4ea90a690ccdbab8a2cb55.tar.gz Vencord-0743c1215e539765cf4ea90a690ccdbab8a2cb55.tar.bz2 Vencord-0743c1215e539765cf4ea90a690ccdbab8a2cb55.zip |
Add canary test
-rw-r--r-- | .github/workflows/reportBrokenPlugins.yml | 14 | ||||
-rw-r--r-- | test/generateReport.ts | 10 |
2 files changed, 20 insertions, 4 deletions
diff --git a/.github/workflows/reportBrokenPlugins.yml b/.github/workflows/reportBrokenPlugins.yml index 8511b42..719eca7 100644 --- a/.github/workflows/reportBrokenPlugins.yml +++ b/.github/workflows/reportBrokenPlugins.yml @@ -41,3 +41,17 @@ jobs: env: DISCORD_TOKEN: ${{ secrets.DISCORD_TOKEN }} DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }} + + - name: Create Report (Canary) + timeout-minutes: 10 + if: success() || failure() # even run if previous one failed + run: | + export PATH="$PWD/node_modules/.bin:$PATH" + export CHROMIUM_BIN=$(which chromium-browser) + export USE_CANARY=true + + esbuild test/generateReport.ts > dist/report.mjs + node dist/report.mjs >> $GITHUB_STEP_SUMMARY + env: + DISCORD_TOKEN: ${{ secrets.DISCORD_TOKEN }} + DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }} diff --git a/test/generateReport.ts b/test/generateReport.ts index 57d4f96..9483225 100644 --- a/test/generateReport.ts +++ b/test/generateReport.ts @@ -31,13 +31,15 @@ for (const variable of ["DISCORD_TOKEN", "CHROMIUM_BIN"]) { } } +const CANARY = process.env.USE_CANARY === "true"; + const browser = await pup.launch({ headless: true, executablePath: process.env.CHROMIUM_BIN }); const page = await browser.newPage(); -await page.setUserAgent("Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.0.0 Safari/537.36"); +await page.setUserAgent("Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36"); function maybeGetError(handle: JSHandle) { return (handle as JSHandle<Error>)?.getProperty("message") @@ -65,7 +67,7 @@ function toCodeBlock(s: string) { } async function printReport() { - console.log("# Vencord Report"); + console.log("# Vencord Report" + (CANARY ? " (Canary)" : "")); console.log(); console.log("## Bad Patches"); @@ -98,7 +100,7 @@ async function printReport() { }, body: JSON.stringify({ description: "Here's the latest Vencord Report!", - username: "Vencord Reporter", + username: "Vencord Reporter" + (CANARY ? " (Canary)" : ""), avatar_url: "https://cdn.discordapp.com/icons/1015060230222131221/f0204a918c6c9c9a43195997e97d8adf.webp", embeds: [ { @@ -271,4 +273,4 @@ await page.evaluateOnNewDocument(` ;(${runTime.toString()})(${JSON.stringify(process.env.DISCORD_TOKEN)}); `); -await page.goto("https://discord.com/login"); +await page.goto(CANARY ? "https://canary.discord.com/login" : "https://discord.com/login"); |