Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Actions testing #225

Merged
merged 10 commits into from
May 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions .github/workflows/node.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs

name: lint_build

on: push

jobs:
build:
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
folder: [website, server]

steps:
- uses: actions/checkout@v4
- name: Use Node.js 18.20.2
uses: actions/setup-node@v4
with:
node-version: 18.20.2
cache: 'yarn'
cache-dependency-path: ./${{ matrix.folder }}/yarn.lock

- name: "${{ matrix.folder }}: install"
run: yarn install --immutable --immutable-cache --check-cache
working-directory: ./${{ matrix.folder }}
- name: "${{ matrix.folder }}: lint"
run: yarn lint
working-directory: ./${{ matrix.folder }}
- name: "${{ matrix.folder }}: build"
run: yarn build
working-directory: ./${{ matrix.folder }}
3 changes: 2 additions & 1 deletion server/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"no-unused-vars": [
"warn"
],
"no-multiple-empty-lines": ["warn", { "max": 2 }]
"no-multiple-empty-lines": ["warn", { "max": 2 }],
"no-useless-escape": ["warn"]
}
}
4 changes: 3 additions & 1 deletion server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
"main": "index.js",
"scripts": {
"serve-server": "nodemon src/index.js",
"register-commands": "node src/discord/register-slash-commands.js"
"register-commands": "node src/discord/register-slash-commands.js",
"lint": "eslint --ext .js,.ts --ignore-path .gitignore --ignore-pattern \"**/_deprecated/*\" --fix src --quiet",
"build": "echo \"No build stage for server - skipping\""
},
"repository": "git+https://github.com/slmnio/slmngg-server.git",
"author": "",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const Airtable = require("airtable");
const airtable = new Airtable({ apiKey: process.env.AIRTABLE_KEY });
const Cache = require("./cache.js");
const Cache = require("../cache.js");
const slmngg = airtable.base(process.env.AIRTABLE_APP);
const ora = require("ora");
const chalk = require("chalk");
Expand Down Expand Up @@ -168,8 +168,8 @@ async function processTableData(tableName, data, linkRecords = false) {
customTableUpdate(tableName, Cache);
}

const customTableUpdate = require("./custom-datasets");
const { log } = require("./discord/slmngg-log");
const customTableUpdate = require("../custom-datasets.js");
const { log } = require("../discord/slmngg-log.js");

function registerUpdater(tableName, options) {
let pollRate = 5000;
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const client = require("./client.js");
const client = require("../discord/client.js");
const Cache = require("../cache.js");
const { update, select } = require("../airtable-interface.js");
const { update, select } = require("./airtable-interface.js");
const Discord = require("discord.js");

let io;
Expand Down
File renamed without changes.
1 change: 1 addition & 0 deletions server/src/discord/staff.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable */
/* BPL Staff Automation */

const client = require("./client.js");
Expand Down