Skip to content

Commit a4796aa

Browse files
authored
Merge pull request #95 from abeimler/feature/arch-linux
2 parents e11034e + cefca0b commit a4796aa

30 files changed

+396
-66
lines changed

.dockerignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.parcel-cache/
2+
node_modules/
3+
dev/docker/
4+
dev/container-tests/

.github/workflows/CI.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,12 +84,14 @@ jobs:
8484
if: ${{ !contains(github.event.head_commit.message, '[skip ci]') && !contains(github.event.head_commit.message, '[skip docker]') }}
8585
runs-on: ${{ matrix.os }}
8686
strategy:
87+
fail-fast: false
8788
matrix:
8889
os:
8990
- ubuntu-20.04
9091
container:
9192
- "ubuntu_node.dockerfile"
9293
- "ubuntu_20.04_node.dockerfile"
94+
- "arch_node.dockerfile"
9395
node:
9496
- 14
9597
pnpm:

CONTRIBUTING.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,5 @@ pnpm install
99
Before running the tests locally, backup your environment variables because faulty code might corrupt the environment.
1010

1111
<https://stackoverflow.com/a/5147185/7910299>
12+
13+
Install [container-structure-test](https://github.com/GoogleContainerTools/container-structure-test) for docker testing.

cspell.config.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ words:
4545
- msys
4646
- multilib
4747
- mxschmitt
48+
- noconfirm
49+
- noprogressbar
4850
- nothrow
4951
- npmrc
5052
- Opencppcoverage
@@ -54,6 +56,7 @@ words:
5456
- pypy
5557
- setupcpp
5658
- setx
59+
- Syuu
5760
- terserrc
5861
- tsbuildinfo
5962
- ucrt

dev/container-tests/arch.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
schemaVersion: 2.0.0
2+
3+
commandTests:
4+
- name: gcc compiler
5+
command: gcc
6+
args: ["--version"]
7+
expectedOutput: [".*gcc.*GCC.*"]
8+
- name: g++ compiler
9+
command: g++
10+
args: ["--version"]
11+
expectedOutput: [".*g\\+\\+.*GCC.*"]
12+
- name: cmake
13+
command: cmake
14+
args: ["--version"]
15+
expectedOutput: [".*cmake version.*"]
16+
- name: make
17+
command: make
18+
args: ["--version"]
19+
expectedOutput: [".*GNU Make.*"]
20+
- name: ninja
21+
command: ninja
22+
args: ["--version"]
23+
expectedOutput: [".*1.*"]
24+
- name: gcovr
25+
command: gcovr
26+
args: ["--version"]
27+
expectedOutput: [".*gcovr.*"]
28+
- name: ccache
29+
command: ccache
30+
args: ["--version"]
31+
expectedOutput: [".*ccache.*"]
32+
- name: doxygen
33+
command: doxygen
34+
args: ["--version"]
35+
expectedOutput: [".*1.*"]
36+
- name: cppcheck
37+
command: cppcheck
38+
args: ["--version"]
39+
expectedOutput: [".*Cppcheck.*"]
40+
41+
fileExistenceTests:
42+
- name: "vcpkg"
43+
path: "/root/vcpkg"
44+
shouldExist: true

dev/container-tests/ubuntu.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
schemaVersion: 2.0.0
2+
3+
commandTests:
4+
- name: gcc compiler
5+
command: gcc
6+
args: ["--version"]
7+
expectedOutput: [".*gcc.*"]
8+
- name: g++ compiler
9+
command: g++
10+
args: ["--version"]
11+
expectedOutput: [".*g\\+\\+.*"]
12+
- name: make
13+
command: make
14+
args: ["--version"]
15+
expectedOutput: [".*GNU Make.*"]
16+
- name: ninja
17+
command: /root/ninja/ninja
18+
args: ["--version"]
19+
expectedOutput: [".*1.*"]
20+
- name: gcovr
21+
command: gcovr
22+
args: ["--version"]
23+
expectedOutput: [".*gcovr.*"]
24+
- name: ccache
25+
command: ccache
26+
args: ["--version"]
27+
expectedOutput: [".*ccache.*"]
28+
- name: doxygen
29+
command: doxygen
30+
args: ["--version"]
31+
expectedOutput: [".*1.*"]
32+
- name: cppcheck
33+
command: cppcheck
34+
args: ["--version"]
35+
expectedOutput: [".*Cppcheck.*"]
36+
- name: clang
37+
command: /root/llvm/bin/clang
38+
args: ["--version"]
39+
expectedOutput: [".*clang.*"]
40+
41+
fileExistenceTests:
42+
- name: "vcpkg"
43+
path: "/root/vcpkg"
44+
shouldExist: true
45+
- name: "llvm"
46+
path: "/root/llvm"
47+
shouldExist: true

dev/docker/arch_node.dockerfile

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
## base image
2+
FROM archlinux as base
3+
4+
RUN pacman -Syuu --noconfirm
5+
6+
# Install packages available from standard repos
7+
RUN pacman-db-upgrade && \
8+
pacman -S --noconfirm --needed \
9+
wget curl pkg-config zip unzip tar git && \
10+
pacman -S --noconfirm \
11+
nodejs && \
12+
pacman -Scc --noconfirm
13+
14+
# install yay
15+
#RUN useradd -m -G nobody -s /bin/bash yay && passwd -d yay && echo "yay ALL=(ALL) ALL" >> /etc/sudoers
16+
#RUN git clone --depth 1 https://aur.archlinux.org/yay.git /opt/yay && cd /opt/yay && \
17+
# chown -R yay:root . && chmod -R 775 . && \
18+
# runuser -l yay -c "cd /opt/yay && makepkg -si --noprogressbar --noconfirm"
19+
20+
# add setup_cpp.js
21+
COPY "./dist/" "/"
22+
WORKDIR "/"
23+
24+
# run installation
25+
RUN node ./setup_cpp.js --compiler llvm --cmake true --ninja true --cppcheck true --ccache true --vcpkg true --doxygen true --gcovr true --task true
26+
27+
# clean up
28+
RUN pacman -Scc --noconfirm
29+
#RUN rm -rf /home/yay/.cache/*
30+
RUN rm -rf /tmp/*
31+
32+
CMD source ~/.cpprc
33+
ENTRYPOINT [ "/bin/bash" ]
34+
35+
#### Building
36+
FROM base AS builder
37+
COPY ./dev/cpp_vcpkg_project /home/app
38+
WORKDIR /home/app
39+
RUN bash -c 'source ~/.cpprc \
40+
&& task build'
41+
42+
### Running environment
43+
# use a distroless image or ubuntu:22.04 if you wish
44+
FROM gcr.io/distroless/cc
45+
# copy the built binaries and their runtime dependencies
46+
COPY --from=builder /home/app/build/my_exe/Release/ /home/app/
47+
WORKDIR /home/app/
48+
ENTRYPOINT ["./my_exe"]

dev/docker/ubuntu_node.dockerfile

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,22 @@ RUN apt-get update -qq
44
RUN apt-get install -y --no-install-recommends nodejs
55

66
# add setup_cpp.js
7-
ADD "./dist/" "/"
7+
COPY "./dist/" "/"
88
WORKDIR "/"
99

1010
# run installation
1111
RUN node ./setup_cpp.js --compiler llvm --cmake true --ninja true --cppcheck true --ccache true --vcpkg true --doxygen true --gcovr true --task true
1212

13+
# clean up
14+
RUN apt-get clean && rm -rf /var/lib/apt/lists/*
15+
RUN rm -rf /tmp/*
16+
1317
CMD source ~/.cpprc
1418
ENTRYPOINT [ "/bin/bash" ]
1519

1620
#### Building
1721
FROM base AS builder
18-
ADD ./dev/cpp_vcpkg_project /home/app
22+
COPY ./dev/cpp_vcpkg_project /home/app
1923
WORKDIR /home/app
2024
RUN bash -c 'source ~/.cpprc \
2125
&& task build'

dist/setup_cpp.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/setup_cpp.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)