ci: fix node builds

This commit is contained in:
abeimler 2023-04-06 16:40:42 +02:00
parent db7a01cfd3
commit ca0fc58327
3 changed files with 39 additions and 5 deletions

View File

@ -26,9 +26,10 @@ jobs:
- macos-11
cache_reset_counter:
- 0
node:
- 16
- 18
include:
- node: 12
pnpm: 6
- node: 16
pnpm: 7
- node: 18
@ -69,7 +70,7 @@ jobs:
if: "!contains(github.event.head_commit.message, '[skip test]')"
run: |
pnpm run test
continue-on-error: ${{ contains(matrix.os, 'ubuntu-18.04') || contains(matrix.node, '12') }}
continue-on-error: ${{ contains(matrix.os, 'ubuntu-18.04') }}
# Create self-contained executable that bundles Nodejs
- name: Create Executable
@ -127,6 +128,7 @@ jobs:
- ubuntu-22.04
container:
- "ubuntu_node.dockerfile"
- "ubuntu_node_legacy.dockerfile"
- "ubuntu_20.04_node_legacy.dockerfile"
- "ubuntu_20.04_node.dockerfile"
- "ubuntu_22.04_node.dockerfile"

View File

@ -1,7 +1,8 @@
FROM ubuntu:22.04 AS base
RUN apt-get update -qq
RUN apt-get install -y --no-install-recommends nodejs
ADD https://deb.nodesource.com/setup_16.x /
RUN chmod +x /node_setup_16.x && /node_setup16.x
RUN apt-get update -qq && apt-get install -y --no-install-recommends nodejs
# add setup-cpp.js
COPY "./dist/node16" "/"

View File

@ -0,0 +1,31 @@
FROM ubuntu:22.04 AS base
RUN apt-get update -qq
RUN apt-get install -y --no-install-recommends nodejs
# add setup-cpp.js
COPY "./dist/node12" "/"
WORKDIR "/"
# run installation
RUN node ./setup-cpp.js --compiler llvm --cmake true --ninja true --cppcheck true --ccache true --vcpkg true --doxygen true --gcovr true --task true --powershell true
CMD ["source", "~/.cpprc"]
ENTRYPOINT [ "/bin/bash" ]
#### Building
FROM base AS builder
COPY ./dev/cpp_vcpkg_project /home/app
WORKDIR /home/app
RUN bash -c 'source ~/.cpprc \
&& task build'
### Running environment
# use a distroless image or ubuntu:22.04 if you wish
FROM gcr.io/distroless/cc as runner
# copy the built binaries and their runtime dependencies
COPY --from=builder /home/app/build/my_exe/Release/ /home/app/
WORKDIR /home/app/
ENTRYPOINT ["./my_exe"]