Skip to content

Commit 28d8edd

Browse files
authored
Merge pull request #164 from abeimler/fix/update-node [skip ci]
2 parents cdcbcdb + d2fe82a commit 28d8edd

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+1402
-1143
lines changed

.dockerignore

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,20 @@
1-
.parcel-cache/
2-
node_modules/
3-
dev/docker/
4-
dev/container-tests/
1+
.git/
2+
# OS metadata
3+
**/.DS_Store
4+
**/Thumbs.db
5+
6+
# Node
7+
**/node_modules
8+
**/package-lock.json
9+
**/temp-*
10+
11+
# TypeScript
12+
**/*.tsbuildinfo
13+
14+
# Build directories
15+
**/packages/*/dist/
16+
**/.parcel-cache
17+
**/exe/
18+
**/*.log
19+
**/*.exe
20+
**/.cache/

.github/workflows/CI.yml

Lines changed: 34 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,9 @@ jobs:
2424
- macos-12
2525
- macos-11
2626
node:
27-
- 16
27+
- 20
2828
pnpm:
29-
- 7
30-
cache_reset_counter:
31-
- 0
29+
- 8
3230
steps:
3331
- uses: actions/checkout@v3
3432
with:
@@ -40,6 +38,7 @@ jobs:
4038
path: |
4139
~/.pnpm-store
4240
D:\.pnpm-store
41+
./node_modules
4342
key: "setupcpp-cache-OS:${{ matrix.os }}-node:${{ matrix.node }}-pnpm:${{ matrix.pnpm }}-${{ hashFiles('./.npmrc') }}-deps:${{ hashFiles('./package.json') }}"
4443
restore-keys: |
4544
"setupcpp-cache-OS:${{ matrix.os }}-"
@@ -81,6 +80,22 @@ jobs:
8180
./dist
8281
retention-days: 1
8382

83+
- name: Setup Node 12
84+
uses: actions/setup-node@v3
85+
with:
86+
node-version: 12
87+
- name: Smoke Test Node 12
88+
run: |
89+
node ./dist/legacy/setup-cpp.js --help
90+
91+
- name: Setup Node 16
92+
uses: actions/setup-node@v3
93+
with:
94+
node-version: 16
95+
- name: Smoke Test Node 16
96+
run: |
97+
node ./dist/node16/setup-cpp.js --help
98+
8499
Release:
85100
needs: Test
86101
if: startsWith(github.ref, 'refs/tags/')
@@ -104,10 +119,11 @@ jobs:
104119
./exe/setup-cpp-x64-windows.exe
105120
./exe/setup-cpp-x64-linux
106121
./exe/setup-cpp-x64-macos
107-
./dist/node12/setup-cpp.js
108-
./dist/node12/setup-cpp.js.map
109-
./dist/node12/
122+
./dist/legacy/setup-cpp.js
123+
./dist/legacy/setup-cpp.js.map
124+
./dist/legacy/
110125
./dist/node16/
126+
./dist/node20/
111127
112128
Docker:
113129
if: ${{ !contains(github.event.head_commit.message, '[skip ci]') && !contains(github.event.head_commit.message, '[skip test]') }}
@@ -116,18 +132,15 @@ jobs:
116132
fail-fast: false
117133
matrix:
118134
os:
119-
- ubuntu-20.04
120-
container:
121-
- "ubuntu_node.dockerfile"
122-
- "ubuntu_20.04_node.dockerfile"
123-
- "arch_node.dockerfile"
124-
- "fedora_node.dockerfile"
135+
- ubuntu-22.04
125136
node:
126-
- 14
137+
- 20
127138
pnpm:
128-
- 6
129-
cache_reset_counter:
130-
- 0
139+
- 8
140+
container:
141+
- "./dev/docker/__tests__/arch.dockerfile"
142+
- "./dev/docker/__tests__/fedora.dockerfile"
143+
- "./dev/docker/__tests__/ubuntu.dockerfile"
131144
steps:
132145
- uses: actions/checkout@v3
133146
with:
@@ -139,9 +152,11 @@ jobs:
139152
path: |
140153
~/.pnpm-store
141154
D:\.pnpm-store
142-
key: "setupcpp-docker-cache-OS:${{ matrix.os }}-node:${{ matrix.node }}-pnpm:${{ matrix.pnpm }}-${{ hashFiles('./.npmrc') }}-deps:${{ hashFiles('./package.json') }}-${{ matrix.cache_reset_counter }}"
155+
./node_modules
156+
key: "setupcpp-docker-cache-OS:${{ matrix.os }}-${{ hashFiles('./.npmrc') }}-deps:${{ hashFiles('./package.json') }}"
143157
restore-keys: |
144158
"setupcpp-docker-cache-OS:${{ matrix.os }}"
159+
145160
- name: Setup Node
146161
uses: actions/setup-node@v3
147162
with:
@@ -159,4 +174,4 @@ jobs:
159174
- name: Build
160175
id: docker_build
161176
run: |
162-
docker build -f ./dev/docker/${{ matrix.container }} -t setup-cpp .
177+
docker build -f ${{ matrix.container }} -t setup-cpp .

.nvm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
v18.15.0

.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
node_modules
2+
package.json
23
pnpm-lock.yaml
34
package-lock.json
45
CHANGELOG.md

README.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -153,29 +153,29 @@ Here is an example for using setup-cpp to make a builder image that has the Cpp
153153

154154
```dockerfile
155155
#### Base Image
156-
FROM ubuntu:22.04 AS base
156+
FROM ubuntu:22.04 as base
157157

158-
# add setup-cpp
159-
RUN apt-get update -qq
160-
RUN apt-get install -y --no-install-recommends npm
161-
RUN npm install -g setup-cpp
158+
# install nodejs and setup-cpp
159+
RUN apt-get update -qq && \
160+
apt-get install -y --no-install-recommends nodejs npm && \
161+
npm install -g setup-cpp
162162

163163
# install llvm, cmake, ninja, and ccache
164-
RUN setup-cpp --compiler llvm --cmake true --ninja true --ccache true --vcpkg true --make true
164+
RUN setup-cpp --compiler llvm --cmake true --ninja true --ccache true --vcpkg true --task true
165165

166-
CMD source ~/.cpprc
167-
ENTRYPOINT [ "/bin/bash" ]
166+
ENTRYPOINT ["/bin/bash"]
168167

169-
#### Building
170-
FROM base AS builder
171-
ADD ./dev/cpp_vcpkg_project /home/app
168+
#### Building (example)
169+
FROM base as builder
170+
COPY ./dev/cpp_vcpkg_project /home/app
172171
WORKDIR /home/app
173172
RUN bash -c 'source ~/.cpprc \
174-
&& make build'
173+
&& task build'
174+
175175

176176
### Running environment
177177
# use a distroless image or ubuntu:22.04 if you wish
178-
FROM gcr.io/distroless/cc
178+
FROM gcr.io/distroless/cc as runner
179179
# copy the built binaries and their runtime dependencies
180180
COPY --from=builder /home/app/build/my_exe/Release/ /home/app/
181181
WORKDIR /home/app/
@@ -217,7 +217,7 @@ jobs:
217217
- name: Build
218218
id: docker_build
219219
run: |
220-
docker build -f ./dev/docker/debian.dockerfile -t setup-cpp .
220+
docker build -f ./dev/docker/ubuntu.dockerfile -t setup-cpp .
221221
```
222222
223223
### Inside GitLab pipelines

dev/docker/__tests__/arch.dockerfile

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
## base image
2+
FROM archlinux as base
3+
4+
# install nodejs
5+
RUN pacman -Syuu --noconfirm && \
6+
pacman-db-upgrade && \
7+
pacman -S --noconfirm --needed nodejs
8+
9+
# add setup-cpp.js (built outside of this dockerfile)
10+
COPY "./dist/legacy" "/"
11+
12+
# run installation
13+
RUN node /setup-cpp.js --compiler llvm --cmake true --ninja true --cppcheck true --ccache true --vcpkg true --doxygen true --gcovr true --task true
14+
15+
ENTRYPOINT ["/bin/bash"]
16+
17+
#### Building (example)
18+
FROM base AS example-builder
19+
COPY ./dev/cpp_vcpkg_project /home/app
20+
WORKDIR /home/app
21+
RUN bash -c 'source ~/.cpprc \
22+
&& task build'
23+
24+
#### Running environment
25+
# use a distroless image or ubuntu:22.04 if you wish
26+
FROM gcr.io/distroless/cc as runner
27+
# copy the built binaries and their runtime dependencies
28+
COPY --from=example-builder /home/app/build/my_exe/Release/ /home/app/
29+
WORKDIR /home/app/
30+
ENTRYPOINT ["./my_exe"]
File renamed without changes.
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
## base image
2+
FROM fedora as base
3+
4+
# install nodejs and setup-cpp
5+
RUN dnf -y install nodejs npm && \
6+
npm install -g setup-cpp
7+
8+
# add setup-cpp.js (built outside of this dockerfile)
9+
COPY "./dist/legacy" "/"
10+
11+
# run installation
12+
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
13+
14+
ENTRYPOINT ["/bin/bash"]
15+
16+
#### Building (example)
17+
FROM base AS example-builder
18+
COPY ./dev/cpp_vcpkg_project /home/app
19+
WORKDIR /home/app
20+
RUN bash -c 'source ~/.cpprc \
21+
&& task build'
22+
23+
#### Running environment
24+
# use a distroless image or ubuntu:22.04 if you wish
25+
FROM gcr.io/distroless/cc as runner
26+
# copy the built binaries and their runtime dependencies
27+
COPY --from=example-builder /home/app/build/my_exe/Release/ /home/app/
28+
WORKDIR /home/app/
29+
ENTRYPOINT ["./my_exe"]
File renamed without changes.

0 commit comments

Comments
 (0)