File tree Expand file tree Collapse file tree 6 files changed +20
-5
lines changed Expand file tree Collapse file tree 6 files changed +20
-5
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ on: [push, pull_request]
4
4
5
5
env :
6
6
node18-image : ubuntu/chiselled-node:18-test
7
+ node20-image : ubuntu/nodejs:20-test
7
8
ubuntu-release : 24.04
8
9
9
10
jobs :
@@ -35,20 +36,34 @@ jobs:
35
36
--output type=oci,dest="chiselled-node.${{ matrix.arch }}.tar" \
36
37
node18
37
38
39
+ - name : Build the ${{ env.node20-image }} image on ${{ matrix.arch }}
40
+ id : build
41
+ uses : canonical/craft-actions/rockcraft-pack@main
42
+ with :
43
+ path : node20/
44
+ verbosity : debug
45
+
38
46
- name : Run tests
39
47
if : ${{ matrix.arch == 'amd64' }}
40
48
run : |
41
49
set -ex
42
50
sudo apt-get update
43
51
sudo apt-get install -y skopeo
44
52
skopeo copy oci-archive:"chiselled-node.${{ matrix.arch }}.tar" docker-daemon:${{ env.node18-image }}
53
+ skopeo copy oci-archive:node20/nodejs_20_amd64.rock docker-daemon:${{ env.node20-image }}
45
54
./tests/run-all-tests ${{ env.node18-image }}
55
+ ./tests/run-all-tests ${{ env.node20-image }}
46
56
47
57
- uses : actions/upload-artifact@v3
48
58
with :
49
59
name : chiselled-node-oci-tarballs
50
60
path : chiselled-node.*.tar
51
61
62
+ - uses : actions/upload-artifact@v3
63
+ with :
64
+ name : node-rocks
65
+ path : node20/*.rock
66
+
52
67
- id : set-outputs
53
68
if : always()
54
69
run : |
Original file line number Diff line number Diff line change 4
4
echo " Running test for Hello World app..."
5
5
6
6
test () {
7
- docker run --rm -v " $PWD /src" :/src:ro " $1 " /src/main.js
7
+ docker run --rm -v " $PWD /src" :/src:ro " $1 " exec node /src/main.js
8
8
}
9
9
10
10
test " $NODE18 "
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ echo "Running test for HTTP Server app..."
5
5
6
6
test () {
7
7
port=1234
8
- container=" $( docker run -d --rm -v " $PWD /src" :/src:ro -p $port :8080 " $1 " /src/main.js) "
8
+ container=" $( docker run -d --rm -v " $PWD /src" :/src:ro -p $port :8080 " $1 " exec node /src/main.js) "
9
9
sleep 1
10
10
output=" $( curl http://localhost:$port /) "
11
11
[ " $output " == " Hello world!" ] || exit 1
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ build() {
9
9
}
10
10
11
11
test () {
12
- docker run --rm -v " $PWD /dist" :/src:ro " $1 " /src/index.js
12
+ docker run --rm -v " $PWD /dist" :/src:ro " $1 " exec node /src/index.js
13
13
}
14
14
15
15
build
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ build() {
11
11
12
12
test () {
13
13
port=1234
14
- container=" $( docker run -d --rm -v " $PWD /dist" :/src:ro -p $port :3000 " $1 " /src/index.js) "
14
+ container=" $( docker run -d --rm -v " $PWD /dist" :/src:ro -p $port :3000 " $1 " exec node /src/index.js) "
15
15
sleep 1
16
16
local output expected
17
17
output=" $( curl http://localhost:$port /) "
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ build() {
11
11
}
12
12
13
13
test () {
14
- docker run --rm -v " $PWD /dist" :/src:ro " $1 " /src/index.mjs
14
+ docker run --rm -v " $PWD /dist" :/src:ro " $1 " exec node /src/index.mjs
15
15
}
16
16
17
17
build
You can’t perform that action at this time.
0 commit comments