File tree 1 file changed +18
-5
lines changed
1 file changed +18
-5
lines changed Original file line number Diff line number Diff line change 10
10
jobs :
11
11
build :
12
12
runs-on : ubuntu-latest
13
+ strategy :
14
+ fail-fast : false
15
+ matrix :
16
+ node-version : [18, 20, 22]
17
+
13
18
steps :
14
19
15
20
16
- - name : Build the Docker image
21
+ - name : Build and test Docker image
17
22
run : |
18
- docker run -i $(docker build -q 18) /bin/sh -c "node --version && npm --version && git --version"
19
- docker run -i $(docker build -q 20) /bin/sh -c "node --version && npm --version && git --version"
20
- docker run -i $(docker build -q 22) /bin/sh -c "node --version && npm --version && git --version"
23
+ echo "Testing Node.js ${{ matrix.node-version }}"
24
+
25
+ # Build and test the Docker image
26
+ IMAGE_PATH="${{ matrix.node-version }}"
27
+ VERSIONS=$(docker run -i $(docker build -q ${IMAGE_PATH}) /bin/sh -c "node --version && npm --version && git --version")
28
+ echo "$VERSIONS"
29
+
30
+ # Check Node.js version
31
+ if ! echo "$VERSIONS" | grep -q "v${{ matrix.node-version }}"; then
32
+ echo "::error::Expected Node.js v${{ matrix.node-version }} but got different version"
33
+ exit 1
34
+ fi
21
35
22
36
auto-merge :
23
37
runs-on : ubuntu-latest
24
38
needs : build
25
-
26
39
permissions :
27
40
pull-requests : write
28
41
contents : write
You can’t perform that action at this time.
0 commit comments