forked from CISC375/Sage
-
Notifications
You must be signed in to change notification settings - Fork 1
58 lines (41 loc) · 1.59 KB
/
node.js.yml
File metadata and controls
58 lines (41 loc) · 1.59 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# 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: node
on:
workflow_call:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: '>=18'
cache: 'npm'
- name: Install required system dependencies
run: |
sudo apt-get update
sudo apt-get install -y libcairo2-dev libjpeg-dev libpango1.0-dev libgif-dev build-essential g++
- name: Install node-gyp
run: npm install -g node-gyp
- run: npm cache clean --force
- run: npm ci
# Add this step to copy config.example.ts to config.ts
- name: Set config file
run: cp config.example.ts config.ts
- name: build
run: |
npm run build 2>&1 | tee build-output.log
if grep -q "node_modules/discord.js/typings/index.d.ts" build-output.log; then
echo "Ignoring build errors from node_modules/discord.js/typings/index.d.ts"
sed -i '/node_modules\/discord\.js\/typings\/index\.d\.ts/d' build-output.log
fi
if grep -q "Error" build-output.log; then
echo "Other build errors found. Failing the workflow."
exit 1
fi
echo "No unignored build errors found. Workflow continues."
- run: npm test
# - name: Start Development
# run: npm run dev