Skip to content

Commit

Permalink
chore: add build test for site
Browse files Browse the repository at this point in the history
  • Loading branch information
GalvinPython committed Jul 22, 2024
1 parent aa33094 commit c20c0f0
Show file tree
Hide file tree
Showing 6 changed files with 13,261 additions and 7,761 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Build Site Test

on:
push:
branches:
- '*'
paths:
- "web/**"

jobs:
lint:
name: ESLint
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Setup Bun
uses: oven-sh/setup-bun@v1

- name: Install dependencies
run: bun install

- name: Run ESLint
run: bun run build
12 changes: 4 additions & 8 deletions .github/workflows/eslint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ on:
push:
branches:
- '*'
pull_request:
types: [opened, reopened, synchronize]

jobs:
lint:
Expand All @@ -16,13 +14,11 @@ jobs:
- name: Checkout code
uses: actions/checkout@v2

- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: '20'
- name: Setup Bun
uses: oven-sh/setup-bun@v1

- name: Install dependencies
run: npm install
run: bun install

- name: Run ESLint
run: npm run lint
run: bun run lint
6 changes: 4 additions & 2 deletions api/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ app.use(express.static(path.join(__dirname, "public")));
app.set("view engine", "ejs");
app.set("views", path.join(__dirname, "views"));

app.disable("x-powered-by");

console.log("Initializing tables...");
await initTables();
console.log("Tables initialized");
Expand Down Expand Up @@ -567,7 +569,7 @@ async function syncFromMee6(guild: string) {
const users = data.players;
let pageNumber = 1;
// this is needed because MEE6 doesn't give us the total amount of pages
// eslint-disable-next-line no-constant-condition
while (true) {
const res = await fetch(`https://mee6.xyz/api/plugins/levels/leaderboard/${guild}?limit=1000&page=${pageNumber}`);
const data = await res.json();
Expand Down Expand Up @@ -636,7 +638,7 @@ async function syncFromLurkr(guild: string) {

let pageNumber = 2;
// this is needed because Lurkr doesn't give us the total amount of pages
// eslint-disable-next-line no-constant-condition
while (true) {
const res = await fetch(`https://api.lurkr.gg/v2/levels/${guild}?page=${pageNumber}`);
const data = await res.json();
Expand Down
Binary file modified bun.lockb
Binary file not shown.
Loading

0 comments on commit c20c0f0

Please sign in to comment.