-
Notifications
You must be signed in to change notification settings - Fork 1
80 lines (68 loc) · 2.42 KB
/
Copy pathci-cd.yml
File metadata and controls
80 lines (68 loc) · 2.42 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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
name: Floppa-Chatbot CI/CD Pipeline
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_dispatch:
inputs:
node_version:
description: 'Node.js version'
required: false
type: choice
options:
- '22'
- '20'
default: '22'
run_syntax_checks:
description: 'Run syntax check on core engine, commands and events'
required: false
type: boolean
default: true
run_full_diagnostics:
description: 'Run full diagnostic test suite'
required: false
type: boolean
default: true
jobs:
test-and-validate:
name: Build, Syntax & Diagnostic Verification
runs-on: ubuntu-latest
steps:
- name: Checkout Source Code
uses: actions/checkout@v4
- name: Setup Node.js Environment
uses: actions/setup-node@v4
with:
node-version: ${{ inputs.node_version || '22' }}
- name: Install System Dependencies for Native Addons
run: |
sudo apt-get update
sudo apt-get install -y build-essential libcairo2-dev libpango1.0-dev libjpeg-dev libgif-dev librsvg2-dev
- name: Cache Node Modules
uses: actions/cache@v4
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install Dependencies
run: npm install && npm rebuild sqlite3 canvas bcrypt
- name: Core System Syntax Verification
if: ${{ inputs.run_syntax_checks != false }}
run: |
node --check index.js Floppa.js Goat.js utils.js
node --check bot/login/login.js bot/login/checkLiveCookie.js
node --check bot/handler/handlerAction.js bot/handler/handlerEvents.js
node --check dashboard/app.js dashboard/routes/api.js
- name: All Commands Syntax Check
if: ${{ inputs.run_syntax_checks != false }}
run: for file in scripts/cmds/*.js; do node --check "$file"; done
- name: All Events Syntax Check
if: ${{ inputs.run_syntax_checks != false }}
run: for file in scripts/events/*.js; do node --check "$file"; done
- name: FCA Engine Unit Tests
run: cd fca && npm test
- name: Run Full Diagnostic Test Suite
if: ${{ inputs.run_full_diagnostics != false }}
run: node scripts/test_cli_runner.js