mirror of
https://github.com/louislam/uptime-kuma.git
synced 2025-09-11 13:36:55 +08:00
Compare commits
8 Commits
louislam-p
...
node22
Author | SHA1 | Date | |
---|---|---|---|
|
cb26b79498 | ||
|
dd5347b25e | ||
|
733ce8ded5 | ||
|
16225acdbd | ||
|
5dce44277f | ||
|
c19eef9e04 | ||
|
9befdd70cc | ||
|
8aebfd82d8 |
4
.github/workflows/auto-test.yml
vendored
4
.github/workflows/auto-test.yml
vendored
@@ -22,7 +22,7 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
os: [macos-latest, ubuntu-latest, windows-latest, ARM64]
|
os: [macos-latest, ubuntu-latest, windows-latest, ARM64]
|
||||||
node: [ 18, 20 ]
|
node: [ 18, 20, 22 ]
|
||||||
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
|
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
@@ -78,7 +78,7 @@ jobs:
|
|||||||
|
|
||||||
e2e-test:
|
e2e-test:
|
||||||
needs: [ ]
|
needs: [ ]
|
||||||
runs-on: ARM64
|
runs-on: e2e
|
||||||
steps:
|
steps:
|
||||||
- run: git config --global core.autocrlf false # Mainly for Windows
|
- run: git config --global core.autocrlf false # Mainly for Windows
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
# If the image changed, the second stage image should be changed too
|
# If the image changed, the second stage image should be changed too
|
||||||
FROM node:20-bookworm-slim AS base2-slim
|
FROM node:22-bookworm-slim AS base2-slim
|
||||||
ARG TARGETPLATFORM
|
ARG TARGETPLATFORM
|
||||||
|
|
||||||
# Specify --no-install-recommends to skip unused dependencies, make the base much smaller!
|
# Specify --no-install-recommends to skip unused dependencies, make the base much smaller!
|
||||||
|
32
extra/download-apprise.mjs
Normal file
32
extra/download-apprise.mjs
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
// Go to http://ftp.debian.org/debian/pool/main/a/apprise/ using fetch api, where it is a apache directory listing page
|
||||||
|
// Use cheerio to parse the html and get the latest version of Apprise
|
||||||
|
// call curl to download the latest version of Apprise
|
||||||
|
// Target file: the latest version of Apprise, which the format is apprise_{VERSION}_all.deb
|
||||||
|
|
||||||
|
import * as cheerio from "cheerio";
|
||||||
|
|
||||||
|
const response = await fetch("http://ftp.debian.org/debian/pool/main/a/apprise/");
|
||||||
|
|
||||||
|
if (!response.ok) {
|
||||||
|
throw new Error("Failed to fetch page of Apprise Debian repository.");
|
||||||
|
}
|
||||||
|
|
||||||
|
const html = await response.text();
|
||||||
|
|
||||||
|
const $ = cheerio.load(html);
|
||||||
|
|
||||||
|
// Get all the links in the page
|
||||||
|
const linkElements = $("a");
|
||||||
|
|
||||||
|
// Filter the links which match apprise_{VERSION}_all.deb
|
||||||
|
const links = [];
|
||||||
|
|
||||||
|
for (let i = 0; i < linkElements.length; i++) {
|
||||||
|
const link = linkElements[i];
|
||||||
|
if (link.attribs.href.match(/apprise_(.*?)_all.deb/) && !link.attribs.href.includes("~")) {
|
||||||
|
links.push(link.attribs.href);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
console.log(links);
|
||||||
|
// TODO: semver compare and download?
|
12
extra/test-backend.mjs
Normal file
12
extra/test-backend.mjs
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
// If Node.js >= 22, run `npm run test-backend-node22`, otherwise run `npm run test-backend-node20`
|
||||||
|
import * as childProcess from "child_process";
|
||||||
|
|
||||||
|
const version = parseInt(process.version.slice(1));
|
||||||
|
|
||||||
|
console.log(`Node.js version: ${version}`);
|
||||||
|
|
||||||
|
if (version >= 22) {
|
||||||
|
childProcess.execSync("npm run test-backend-node22", { stdio: "inherit" });
|
||||||
|
} else {
|
||||||
|
childProcess.execSync("npm run test-backend-node20", { stdio: "inherit" });
|
||||||
|
}
|
@@ -27,7 +27,9 @@
|
|||||||
"build": "vite build --config ./config/vite.config.js",
|
"build": "vite build --config ./config/vite.config.js",
|
||||||
"test": "npm run test-backend && npm run test-e2e",
|
"test": "npm run test-backend && npm run test-e2e",
|
||||||
"test-with-build": "npm run build && npm test",
|
"test-with-build": "npm run build && npm test",
|
||||||
"test-backend": "cross-env TEST_BACKEND=1 node --test test/backend-test",
|
"test-backend": "node extra/test-backend.mjs",
|
||||||
|
"test-backend-node20": "cross-env TEST_BACKEND=1 node --test test/backend-test",
|
||||||
|
"test-backend-node22": "cross-env TEST_BACKEND=1 node --test test/backend-test/test-*.js && node --test test/backend-test/**/test-*.js",
|
||||||
"test-e2e": "playwright test --config ./config/playwright.config.js",
|
"test-e2e": "playwright test --config ./config/playwright.config.js",
|
||||||
"test-e2e-ui": "playwright test --config ./config/playwright.config.js --ui --ui-port=51063",
|
"test-e2e-ui": "playwright test --config ./config/playwright.config.js --ui --ui-port=51063",
|
||||||
"playwright-codegen": "playwright codegen localhost:3000 --save-storage=./private/e2e-auth.json",
|
"playwright-codegen": "playwright codegen localhost:3000 --save-storage=./private/e2e-auth.json",
|
||||||
|
Reference in New Issue
Block a user