-
Notifications
You must be signed in to change notification settings - Fork 12
121 lines (96 loc) · 3.2 KB
/
lodex-ci.yml
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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
name: Lodex CI
# Run this ci only on pull request who targets master and on master branch only
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
# Job use to create the test environment and run unit test suite
test-unit:
runs-on: ubuntu-20.04
# Set a timeout of 10 mins
timeout-minutes: 10
# Create a strategy matrix uses to test multiple versions of node
strategy:
fail-fast: false
matrix:
# See https://github.com/nodejs/Release
node-version: [ 18.x ]
steps:
# Pull repository content
- uses: actions/checkout@v4
# Setup NodeJS
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
# Install project dependencies (equivalent to make install)
- run: make copy-conf
- run: npm ci --legacy-peer-deps
# Run unit test suite
- run: npm run test:unit
# Job use to create the test environment and run api e2e test suite
test-api-e2e:
runs-on: ubuntu-20.04
# Set a timeout of 10 mins
timeout-minutes: 10
# Create a strategy matrix uses to test multiple versions of node
strategy:
fail-fast: false
matrix:
node-version: [ 18.x ]
steps:
# Pull repository content
- uses: actions/checkout@v4
# Setup NodeJS
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
# Install project dependencies (equivalent to make install)
- run: make copy-conf
- run: npm ci --legacy-peer-deps
# Run api e2e test suite
- run: make test-api-e2e
# Job use to create the test environment and run e2e test suite
test-e2e:
runs-on: ubuntu-20.04
# Set a timeout of 30 mins
timeout-minutes: 30
# Create a strategy matrix uses to test multiple versions of node and multiple subset tests
strategy:
fail-fast: false
matrix:
node-version: [ 18.x ]
test-phase: [ 'phase:one', 'phase:two', 'phase:three', 'phase:four' ]
# Use this line to ignore the phase system
# test-phase: [ 'all' ]
steps:
# Pull repository content
- uses: actions/checkout@v4
# Setup NodeJS
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
# Install project dependencies (equivalent to make install)
- run: make copy-conf
- run: npm ci --legacy-peer-deps
# Start e2e environment
- run: make test-e2e-start-dockers
# Wait for the e2e environment to start and then run e2e subset tests suite
- run: ./bin/wait-for -t 60 localhost:3000
- run: npm run test:e2e:${{ matrix.test-phase }}
# Stop e2e environment
- run: make test-e2e-stop-dockers
# Upload debug screenshots on failure
- name: Upload screenshots
uses: actions/upload-artifact@v2
if: failure()
with:
name: cypress-screenshots
path: cypress/screenshots