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]
44
55env :
66 node18-image : ubuntu/chiselled-node:18-test
7+ node20-image : ubuntu/nodejs:20-test
78 ubuntu-release : 24.04
89
910jobs :
@@ -35,20 +36,34 @@ jobs:
3536 --output type=oci,dest="chiselled-node.${{ matrix.arch }}.tar" \
3637 node18
3738
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+
3846 - name : Run tests
3947 if : ${{ matrix.arch == 'amd64' }}
4048 run : |
4149 set -ex
4250 sudo apt-get update
4351 sudo apt-get install -y skopeo
4452 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 }}
4554 ./tests/run-all-tests ${{ env.node18-image }}
55+ ./tests/run-all-tests ${{ env.node20-image }}
4656
4757 - uses : actions/upload-artifact@v3
4858 with :
4959 name : chiselled-node-oci-tarballs
5060 path : chiselled-node.*.tar
5161
62+ - uses : actions/upload-artifact@v3
63+ with :
64+ name : node-rocks
65+ path : node20/*.rock
66+
5267 - id : set-outputs
5368 if : always()
5469 run : |
Original file line number Diff line number Diff line change 44echo " Running test for Hello World app..."
55
66test () {
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
88}
99
1010test " $NODE18 "
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ echo "Running test for HTTP Server app..."
55
66test () {
77 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) "
99 sleep 1
1010 output=" $( curl http://localhost:$port /) "
1111 [ " $output " == " Hello world!" ] || exit 1
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ build() {
99}
1010
1111test () {
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
1313}
1414
1515build
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ build() {
1111
1212test () {
1313 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) "
1515 sleep 1
1616 local output expected
1717 output=" $( curl http://localhost:$port /) "
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ build() {
1111}
1212
1313test () {
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
1515}
1616
1717build
You can’t perform that action at this time.
0 commit comments