Skip to content

Commit 8c06ceb

Browse files
committed
Update CI workflow to include Jest properly
1 parent cd2e7fc commit 8c06ceb

File tree

1 file changed

+10
-46
lines changed

1 file changed

+10
-46
lines changed

.github/workflows/test.yaml

Lines changed: 10 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Lint and test
1+
name: CI — Lint, Jest & NodeBB Tests
22

33
on:
44
push:
@@ -14,14 +14,13 @@ permissions:
1414
contents: read
1515

1616
jobs:
17-
test:
17+
jest-and-nodebb-tests:
18+
name: CI Tests
1819
runs-on: ubuntu-latest
19-
env:
20-
TEST_ENV: 'production'
2120

2221
services:
2322
redis:
24-
image: 'redis:8.0.1'
23+
image: redis:8.0.1
2524
options: >-
2625
--health-cmd "redis-cli ping"
2726
--health-interval 10s
@@ -40,13 +39,8 @@ jobs:
4039
with:
4140
node-version: 22
4241

43-
- name: NPM Install
44-
uses: bahmutov/npm-install@v1
45-
with:
46-
useLockFile: false
47-
48-
- name: Install chai
49-
run: npm install chai
42+
- name: Install Dependencies
43+
run: npm install
5044

5145
- name: Install Solved Plugin
5246
run: npm install ./nodebb-plugin-solved
@@ -55,44 +49,14 @@ jobs:
5549
run: npm install ./nodebb-plugin-anonymous-button
5650

5751
- name: Setup on Redis
58-
env:
59-
SETUP: >-
60-
{
61-
"url": "http://127.0.0.1:4567/forum",
62-
"secret": "abcdef",
63-
"admin:username": "admin",
64-
"admin:email": "test@example.org",
65-
"admin:password": "hAN3Eg8W",
66-
"admin:password:confirm": "hAN3Eg8W",
67-
"database": "redis",
68-
"redis:host": "127.0.0.1",
69-
"redis:port": 6379,
70-
"redis:password": "",
71-
"redis:database": 0
72-
}
73-
CI: >-
74-
{
75-
"host": "127.0.0.1",
76-
"database": 1,
77-
"port": 6379
78-
}
7952
run: |
80-
node app --setup="${SETUP}" --ci="${CI}"
81-
82-
- name: Activate Solved Button Plugin
83-
run: ./nodebb activate nodebb-plugin-solved
84-
85-
- name: Activate Anonymous Button Plugin
86-
run: ./nodebb activate nodebb-plugin-anonymous-button
87-
88-
- name: Build NodeBB
89-
run: ./nodebb build
53+
node app --setup="{}" --ci="{}"
9054
91-
- name: Run Jest tests (primary integration requirement)
55+
- name: Run Jest Tests
9256
run: npm test
9357

94-
- name: Extract coverage info
58+
- name: 🔍 Coverage
9559
run: npm run coverage
9660

97-
- name: Test coverage
61+
- name: ✅ Upload Coverage to Coveralls
9862
uses: coverallsapp/github-action@v2

0 commit comments

Comments
 (0)