Skip to content

Commit

Permalink
Add Actions for linting & building (#225)
Browse files Browse the repository at this point in the history
* Create node.yml

* Update node.yml

* Update node.yml

* me when i'm stupid

* hey do you like this folder

* Update node.yml to only push events

* add commands to server directory

* cleaning up server
see zusorio@c4513f2

* go away deprecated files i should just delete

* avoid v16 warnings
  • Loading branch information
slmnio authored May 1, 2024
1 parent 414cfdd commit ea75b95
Show file tree
Hide file tree
Showing 9 changed files with 45 additions and 7 deletions.
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.
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

0 comments on commit ea75b95

Please sign in to comment.