-
Notifications
You must be signed in to change notification settings - Fork 1
89 lines (75 loc) · 2.38 KB
/
cp_testing.yml
File metadata and controls
89 lines (75 loc) · 2.38 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
81
82
83
84
85
86
87
88
89
name: Compatibility testing
run-name: ubuntu + browser + NodeJS + postgres
on:
workflow_dispatch:
jobs:
compatibility-tests:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
node: [14, 18, 20]
browser: [chrome, firefox, edge]
services:
postgres:
image: postgres:15
env:
POSTGRES_USER: wikijs
POSTGRES_PASSWORD: wikijsrocks
POSTGRES_DB: wiki
ports:
- 5432:5432
options: >-
--health-cmd "pg_isready -U wikijs -d wiki"
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- name: Checkout Repo
uses: actions/checkout@v4
with:
path: mainrepo
- name: Checkout Wiki.js source
run: |
wget https://github.com/Requarks/wiki/releases/latest/download/wiki-js.tar.gz
mkdir wikijs
tar xzf wiki-js.tar.gz -C ./wikijs
cd wikijs
mv config.sample.yml config.yml
- name: Setup Node.js ${{ matrix.node }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
- name: Install dependencies
run: |
cd wikijs
npm install --no-audit --no-fund --legacy-peer-deps
- name: Set Database ENV
run: |
echo "DB_TYPE=postgres" >> $GITHUB_ENV
echo "DB_HOST=localhost" >> $GITHUB_ENV
echo "DB_PORT=5432" >> $GITHUB_ENV
echo "DB_USER=wikijs" >> $GITHUB_ENV
echo "DB_PASS=wikijsrocks" >> $GITHUB_ENV
echo "DB_NAME=wiki" >> $GITHUB_ENV
- name: Build Wiki.js
run: |
cd wikijs
echo "Running build on Node ${{ matrix.node }} and Browser ${{ matrix.browser }}"
- name: Start Wiki.js server
run: |
cd wikijs
nohup node server > server.log 2>&1 &
sleep 20
cat server.log
- name: Test server response
run: |
curl -I http://localhost:3000 || (cat wikijs/server.log && exit 1)
- name: Install Playwright
run: |
npm install -D @playwright/test
npx playwright install --with-deps
- name: Run Playwright Tests
working-directory: mainrepo
run: |
npx playwright test --config=playwright.config.ts --project=${{ matrix.browser }}