-
Notifications
You must be signed in to change notification settings - Fork 5
106 lines (90 loc) · 3.53 KB
/
node.js.yml
File metadata and controls
106 lines (90 loc) · 3.53 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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
# This workflow will do a clean install of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
name: Node.js CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
integration-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v6
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- run: npm ci
- name: Run Integration tests
run: DEBUG=replay* npm run coverage
# FIXME 'Test run failed replay no longer is working with latest nano which uses node fetch'
deploy:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [25.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
steps:
- uses: actions/checkout@v6
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v6
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- run: npm ci
- run: npm run lint:ci
- name: Create local config for the app to connect to couchdb service in the container
run: |
echo 'module.exports = { usersDbConnection: { url: "http://couchdb:5984" }};' > config/localhost.js
- name: Start docker compose services
run: docker compose up -d && sleep 5
- name: Show docker compose logs after creating services
run: docker compose logs --no-color --timestamps || true
- name: Run setup databases in the couchdb inside the container
run: npm run setup
env:
SOURCE_URL: ${{ secrets.SOURCE_URL }}
DEBUG: 'none'
- name: Run E2E tests against the container app
run: DEBUG=test:deprecated npm run test:deprecated:e2e
env:
SOURCE_URL: ${{ secrets.SOURCE_URL }}
DEBUG: 'none'
- name: Show app logs after running tests
if: failure()
run: docker compose logs --no-color --timestamps | grep -v "couchdb" || true
- name: Create local config for tests to use the couchdb outside the container
run: |
echo 'module.exports = { usersDbConnection: { url: "http://localhost:5984" }};' > config/localhost.js
- name: Run integration tests using the app against the couchdb in the contianer
run: npm run test:deprecated:coverage
env:
SOURCE_URL: ${{ secrets.SOURCE_URL }}
DEBUG: 'none' # 'test:deprecated'
- name: Upload coverage report
uses: actions/upload-artifact@v7
if: success() || failure()
with:
name: coverage
path: coverage/
retention-days: 3
- name: Coveralls
if: success() || failure()
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Run UI tests
run: npm run test:ui || echo "TODO ui tests fail, update prototypedev couchapp"
timeout-minutes: 5
env:
BASE_URL: https://localhost:6984
BASE_PATH: /prototypedev/_design/prototype
- name: Upload Playwright report and traces for trace.playwright.dev
uses: actions/upload-artifact@v7
if: ${{ !cancelled() }} # Upload even if the previous step failed
with:
name: ui-test-results # Name of the artifact
path: FieldDB/test-e2e/test-results/ # Path to the directory containing reports and traces
retention-days: 30