Skip to content

Commit b6fac14

Browse files
ci: run int tests for maintainence node version
1 parent 6287de4 commit b6fac14

File tree

1 file changed

+62
-73
lines changed

1 file changed

+62
-73
lines changed

.circleci/config.yml

+62-73
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,16 @@ parameters:
66
default: false
77
legacy-node-version:
88
type: string
9-
default: "14.21.3"
9+
default: '14.21.3'
1010
maintenance-node-version:
1111
type: string
12-
default: "16.20"
12+
default: '16.20'
1313
active-node-version:
1414
type: string
15-
default: "18.17"
15+
default: '18.17'
1616
current-node-version:
1717
type: string
18-
default: "20.5"
18+
default: '20.5'
1919

2020
aliases:
2121
- &restore-cache
@@ -65,7 +65,11 @@ jobs:
6565
- when:
6666
condition:
6767
and:
68-
- equal: [ "<< parameters.node-version >>", "<< pipeline.parameters.legacy-node-version >>" ]
68+
- equal:
69+
[
70+
'<< parameters.node-version >>',
71+
'<< pipeline.parameters.legacy-node-version >>',
72+
]
6973
- not: << pipeline.parameters.check-legacy-node-version >>
7074
steps:
7175
- run:
@@ -76,7 +80,11 @@ jobs:
7680
condition:
7781
or:
7882
- not:
79-
equal: [ "<< parameters.node-version >>", "<< pipeline.parameters.legacy-node-version >>" ]
83+
equal:
84+
[
85+
'<< parameters.node-version >>',
86+
'<< pipeline.parameters.legacy-node-version >>',
87+
]
8088
- << pipeline.parameters.check-legacy-node-version >>
8189
steps:
8290
- checkout
@@ -85,7 +93,11 @@ jobs:
8593
- *build-packages
8694
- when:
8795
condition:
88-
equal: [ "<< parameters.node-version >>", "<< pipeline.parameters.maintenance-node-version >>" ]
96+
equal:
97+
[
98+
'<< parameters.node-version >>',
99+
'<< pipeline.parameters.maintenance-node-version >>',
100+
]
89101
steps:
90102
- run:
91103
name: Test (coverage)
@@ -98,7 +110,11 @@ jobs:
98110
- when:
99111
condition:
100112
not:
101-
equal: [ "<< parameters.node-version >>", "<< pipeline.parameters.maintenance-node-version >>" ]
113+
equal:
114+
[
115+
'<< parameters.node-version >>',
116+
'<< pipeline.parameters.maintenance-node-version >>',
117+
]
102118
steps:
103119
- *run-unit-tests
104120

@@ -118,59 +134,39 @@ jobs:
118134
command: ./node_modules/.bin/commitlint-circle -c .commitlintrc.json
119135

120136
integration_tests:
121-
parameters:
122-
node-version:
123-
type: string
124137
working_directory: ~/nest
125138
machine: true
126139
steps:
127-
- when:
128-
condition:
129-
and:
130-
- equal: [ "<< parameters.node-version >>", "<< pipeline.parameters.legacy-node-version >>" ]
131-
- not: << pipeline.parameters.check-legacy-node-version >>
132-
steps:
133-
- run:
134-
name: Skip
135-
command: |
136-
echo Skipping
137-
- when:
138-
condition:
139-
or:
140-
- not:
141-
equal: [ "<< parameters.node-version >>", "<< pipeline.parameters.legacy-node-version >>" ]
142-
- << pipeline.parameters.check-legacy-node-version >>
143-
steps:
144-
- checkout
145-
- run:
146-
name: Prepare nvm
147-
command: |
148-
echo 'export NVM_DIR="/opt/circleci/.nvm"' >> $BASH_ENV
149-
echo ' [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"' >> $BASH_ENV
150-
- run:
151-
name: Upgrade Node.js
152-
command: |
153-
nvm install << parameters.node-version >>
154-
node -v
155-
nvm alias default << parameters.node-version >>
156-
- run:
157-
name: Install Docker Compose
158-
command: |
159-
curl -L https://github.com/docker/compose/releases/download/1.19.0/docker-compose-`uname -s`-`uname -m` > ~/docker-compose
160-
chmod +x ~/docker-compose
161-
sudo mv ~/docker-compose /usr/local/bin/docker-compose
162-
- *install-deps
163-
- run:
164-
name: Prepare tests
165-
command: |
166-
bash ./scripts/prepare.sh
167-
sleep 10
168-
- run:
169-
name: List containers
170-
command: docker ps
171-
- run:
172-
name: Integration tests
173-
command: npm run test:integration
140+
- checkout
141+
- run:
142+
name: Prepare nvm
143+
command: |
144+
echo 'export NVM_DIR="/opt/circleci/.nvm"' >> $BASH_ENV
145+
echo ' [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"' >> $BASH_ENV
146+
- run:
147+
name: Upgrade Node.js
148+
command: |
149+
nvm install << pipeline.parameters.maintenance-node-version >>
150+
node -v
151+
nvm alias default << pipeline.parameters.maintenance-node-version >>
152+
- run:
153+
name: Install Docker Compose
154+
command: |
155+
curl -L https://github.com/docker/compose/releases/download/1.19.0/docker-compose-`uname -s`-`uname -m` > ~/docker-compose
156+
chmod +x ~/docker-compose
157+
sudo mv ~/docker-compose /usr/local/bin/docker-compose
158+
- *install-deps
159+
- run:
160+
name: Prepare tests
161+
command: |
162+
bash ./scripts/prepare.sh
163+
sleep 10
164+
- run:
165+
name: List containers
166+
command: docker ps
167+
- run:
168+
name: Integration tests
169+
command: npm run test:integration
174170

175171
codechecks_benchmarks:
176172
working_directory: ~/nest
@@ -193,7 +189,7 @@ jobs:
193189
docker:
194190
- image: cimg/node:<< pipeline.parameters.maintenance-node-version >>
195191
environment:
196-
DISABLE_OPENCOLLECTIVE: "true"
192+
DISABLE_OPENCOLLECTIVE: 'true'
197193
steps:
198194
- checkout
199195
- *restore-cache
@@ -211,26 +207,19 @@ workflows:
211207
- build
212208
matrix:
213209
parameters:
214-
node-version: [
215-
"<< pipeline.parameters.legacy-node-version >>",
216-
"<< pipeline.parameters.maintenance-node-version >>",
217-
"<< pipeline.parameters.active-node-version >>",
218-
"<< pipeline.parameters.current-node-version >>"
219-
]
210+
node-version:
211+
[
212+
'<< pipeline.parameters.legacy-node-version >>',
213+
'<< pipeline.parameters.maintenance-node-version >>',
214+
'<< pipeline.parameters.active-node-version >>',
215+
'<< pipeline.parameters.current-node-version >>',
216+
]
220217
- lint:
221218
requires:
222219
- build
223220
- integration_tests:
224221
requires:
225222
- build
226-
matrix:
227-
parameters:
228-
node-version: [
229-
"<< pipeline.parameters.legacy-node-version >>",
230-
"<< pipeline.parameters.maintenance-node-version >>",
231-
"<< pipeline.parameters.active-node-version >>",
232-
"<< pipeline.parameters.current-node-version >>"
233-
]
234223
- samples:
235224
requires:
236225
- build

0 commit comments

Comments
 (0)