forked from CISC375/Sage
-
Notifications
You must be signed in to change notification settings - Fork 1
58 lines (43 loc) · 1.68 KB
/
node.js.yml
File metadata and controls
58 lines (43 loc) · 1.68 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
with:
fetch-depth: 0
ref: ${{ github.sha }}
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: "20"
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++
- run: npm cache clean --force
- run: npm ci
- name: Set config file
run: cp config.example.ts config.ts
- name: build
run: |
npm run build 2>&1 | tee build-output.log || true
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"
fi
if grep -i "error" build-output.log | grep -v "node_modules/discord.js/typings/index.d.ts"; then
echo "Build failed with unignored errors"
exit 1
fi
echo "No unignored build errors found. Workflow continues."
- name: Show Jest config
run: npx jest --showConfig | sed -n '1,120p'
- name: Run tests (no cache)
run: npx jest -c jest.config.js --no-cache
# - name: Start Development
# run: npm run dev