-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
109 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
* @xuhdev |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
# @license AGPL-3.0-or-later | ||
# | ||
# Copyright(C) 2025 Hong Xu <[email protected]> | ||
# | ||
# This program is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU Affero General Public License as | ||
# published by the Free Software Foundation, either version 3 of the | ||
# License, or (at your option) any later version. | ||
# | ||
# This program is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU Affero General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU Affero General Public License | ||
# along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
|
||
name: Lint | ||
|
||
on: | ||
push: | ||
branches: ["master"] | ||
pull_request: | ||
branches: ["master"] | ||
|
||
jobs: | ||
lint: | ||
name: Lint | ||
runs-on: ubuntu-24.04 | ||
|
||
steps: | ||
- uses: actions/[email protected] | ||
|
||
- name: Use Node.js | ||
uses: actions/[email protected] | ||
with: | ||
node-version: 22 | ||
cache: "npm" | ||
|
||
- name: Install Dependencies | ||
run: npm ci | ||
|
||
- name: Install Caddy | ||
run: | | ||
sudo apt install -y debian-keyring debian-archive-keyring apt-transport-https curl | ||
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/gpg.key' | sudo gpg --dearmor -o /usr/share/keyrings/caddy-stable-archive-keyring.gpg | ||
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/debian.deb.txt' | sudo tee /etc/apt/sources.list.d/caddy-stable.list | ||
sudo apt update | ||
sudo apt install caddy | ||
- name: Lint | ||
run: npm run lint |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
# @license AGPL-3.0-or-later | ||
# | ||
# Copyright(C) 2025 Hong Xu <[email protected]> | ||
# | ||
# This program is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU Affero General Public License as | ||
# published by the Free Software Foundation, either version 3 of the | ||
# License, or (at your option) any later version. | ||
# | ||
# This program is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU Affero General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU Affero General Public License | ||
# along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
|
||
name: Runtime | ||
|
||
on: | ||
push: | ||
branches: ["master"] | ||
pull_request: | ||
branches: ["master"] | ||
|
||
jobs: | ||
test: | ||
name: Runtime | ||
runs-on: ubuntu-24.04 | ||
|
||
steps: | ||
- uses: actions/[email protected] | ||
|
||
- name: Use Node.js | ||
uses: actions/[email protected] | ||
with: | ||
node-version: 22 | ||
cache: "npm" | ||
|
||
- name: Install podman | ||
run: sudo apt-get update && sudo apt-get install -y podman | ||
|
||
- name: Build | ||
run: npm run build | ||
|
||
- name: Start the container | ||
run: podman run --detach -p 3000:80 -p 3001:443 app | ||
|
||
- name: Install npm dependencies | ||
run: npm ci | ||
|
||
- name: Run test | ||
run: npm run test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,14 +7,12 @@ | |
"author": "Hong Xu <[email protected]>", | ||
"type": "module", | ||
"scripts": { | ||
"lint": "eslint *.ts *.mjs && prettier . --check", | ||
"lint": "eslint *.ts *.mjs && prettier . --check && caddy fmt --diff Caddyfile.base", | ||
"build": "podman build . -t app", | ||
"start": "podman run -it --rm -p 3000:80 -p 3001:443 app", | ||
"test": "vitest --run index.test.ts", | ||
"test_live": "vitest --run docker.test.ts", | ||
"format": "eslint --fix *.ts *.mjs && prettier . --write", | ||
"compile": "tsc -p tsconfig.json", | ||
"dev": "npm run build && node dist/index.js" | ||
"format": "eslint --fix *.ts *.mjs && prettier . --write && caddy fmt --overwrite Caddyfile.base", | ||
"compile": "tsc -p tsconfig.json" | ||
}, | ||
"devDependencies": { | ||
"@types/eslint": "^9.6.1", | ||
|