-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6bb9ec2
commit a0148ff
Showing
13 changed files
with
241 additions
and
84 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
build --cxxopt=-std=c++17 | ||
build -c dbg | ||
build --cxxopt=-Wall | ||
build --cxxopt=-Wextra | ||
build --cxxopt=-Wpedantic | ||
build --cxxopt=-Werror | ||
|
||
coverage --experimental_fetch_all_coverage_outputs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
# Use the official Ubuntu base image | ||
FROM ubuntu:22.04 | ||
|
||
# Avoid interactive package installation | ||
ENV DEBIAN_FRONTEND=noninteractive | ||
|
||
# Install required packages | ||
RUN apt-get update && apt-get install -y \ | ||
build-essential \ | ||
git \ | ||
curl \ | ||
wget \ | ||
unzip \ | ||
python3 \ | ||
python3-pip \ | ||
gdb \ | ||
lldb \ | ||
clang \ | ||
clang-format \ | ||
llvm \ | ||
software-properties-common \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
# Install Bazel | ||
RUN apt-get update && apt-get install -y apt-transport-https curl gnupg && \ | ||
curl -fsSL https://bazel.build/bazel-release.pub.gpg | gpg --dearmor >bazel-archive-keyring.gpg && \ | ||
mv bazel-archive-keyring.gpg /usr/share/keyrings/bazel-archive-keyring.gpg && \ | ||
echo "deb [signed-by=/usr/share/keyrings/bazel-archive-keyring.gpg] https://storage.googleapis.com/bazel-apt stable jdk1.8" | tee /etc/apt/sources.list.d/bazel.list && \ | ||
apt-get update && apt-get install -y bazel && \ | ||
apt-get clean && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
# Upgrade Bazel | ||
RUN apt-get update && apt-get full-upgrade -y bazel | ||
|
||
# Create a non-root user | ||
ARG USERNAME=vscode | ||
ARG USER_UID=1000 | ||
ARG USER_GID=$USER_UID | ||
|
||
RUN groupadd --gid $USER_GID $USERNAME \ | ||
&& useradd --uid $USER_UID --gid $USER_GID -m $USERNAME -s /bin/bash \ | ||
&& apt-get install -y sudo \ | ||
&& echo $USERNAME ALL=\(ALL\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME \ | ||
&& chmod 0440 /etc/sudoers.d/$USERNAME | ||
|
||
RUN wget https://github.com/bazelbuild/buildtools/releases/download/v7.3.1/buildifier-linux-amd64 \ | ||
&& chmod +x buildifier-linux-amd64 \ | ||
&& sudo mv buildifier-linux-amd64 /usr/local/bin/buildifier | ||
|
||
RUN wget https://cmake.org/files/v3.22/cmake-3.22.6-linux-x86_64.sh \ | ||
&& chmod +x cmake-3.22.6-linux-x86_64.sh \ | ||
&& sudo ./cmake-3.22.6-linux-x86_64.sh --prefix=/usr/local --skip-license | ||
|
||
# Set the user to vscode | ||
USER $USERNAME | ||
|
||
# Set the workspace directory | ||
WORKDIR /workspace |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
{ | ||
"name": "C++ Development with CMake and Bazel", | ||
"dockerFile": "Dockerfile", | ||
"customizations": { | ||
"vscode": { | ||
"extensions": [ | ||
"ms-vscode.cpptools", | ||
"ms-vscode.cmake-tools", | ||
"ms-vscode.cpptools-extension-pack", | ||
"bazelbuild.vscode-bazel", | ||
"xaver.clang-format", | ||
"twxs.cmake", | ||
"fredericbonnet.cmake-test-adapter", | ||
"streetsidesoftware.code-spell-checker" | ||
] | ||
} | ||
}, | ||
"mounts": [ | ||
"source=${localWorkspaceFolder},target=/workspace,type=bind,consistency=cached", | ||
"source=${env:HOME}/.ssh,target=/home/vscode/.ssh,type=bind,consistency=cached" | ||
], | ||
"workspaceFolder": "/workspace", | ||
"runArgs": [ | ||
"--cap-add=SYS_PTRACE", | ||
"--security-opt", | ||
"seccomp=unconfined" | ||
], | ||
"remoteUser": "vscode" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,4 +16,14 @@ jobs: | |
path: "~/.cache/bazel" | ||
key: bazel | ||
|
||
- run: bazel test poly_map_test --test_output=all | ||
- run: bazel coverage poly_map_test --test_output=all | ||
|
||
- name: Coverage | ||
run: | | ||
sudo apt install -y lcov \ | ||
&& lcov --capture --directory $(bazel info bazel-testlogs)/poly_map_test/ --output-file coverage.info | ||
- name: Upload coverage reports to Codecov | ||
uses: codecov/[email protected] | ||
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"recommendations": [ | ||
"ms-vscode-remote.remote-containers", | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
{ | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"name": "Debug CMake Test", | ||
"type": "cppdbg", | ||
"request": "launch", | ||
"program": "${workspaceFolder}/build/tests/poly_map_test", | ||
"args": [], | ||
"stopAtEntry": false, | ||
"cwd": "${workspaceFolder}", | ||
"environment": [], | ||
"externalConsole": false, | ||
"MIMode": "gdb", | ||
"setupCommands": [ | ||
{ | ||
"description": "Enable pretty-printing for gdb", | ||
"text": "-enable-pretty-printing", | ||
"ignoreFailures": true | ||
} | ||
], | ||
"preLaunchTask": "Build with CMake", | ||
"miDebuggerPath": "/usr/bin/gdb", | ||
"logging": { | ||
"trace": true, | ||
"engineLogging": true, | ||
"traceResponse": true | ||
} | ||
}, | ||
{ | ||
"name": "Debug Bazel Test", | ||
"type": "cppdbg", | ||
"request": "launch", | ||
"program": "${workspaceFolder}/bazel-bin/poly_map_test", | ||
"args": [], | ||
"stopAtEntry": false, | ||
"cwd": "${workspaceFolder}", | ||
"environment": [], | ||
"externalConsole": false, | ||
"MIMode": "gdb", | ||
"setupCommands": [ | ||
{ | ||
"description": "Enable pretty-printing for gdb", | ||
"text": "-enable-pretty-printing", | ||
"ignoreFailures": true | ||
} | ||
], | ||
"preLaunchTask": "Build Bazel Debug", | ||
"miDebuggerPath": "/usr/bin/gdb", | ||
"logging": { | ||
"trace": true, | ||
"engineLogging": true, | ||
"traceResponse": true | ||
}, | ||
"internalConsoleOptions": "openOnSessionStart" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
{ | ||
"files.insertFinalNewline": true, | ||
"files.trimFinalNewlines": true, | ||
"editor.defaultFormatter": "xaver.clang-format", | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
{ | ||
"version": "2.0.0", | ||
"inputs": [ | ||
{ | ||
"id": "pickFlakyTest", | ||
"type": "command", | ||
"command": "bazel.pickTarget", | ||
"args": { | ||
"query": "kind('.*_test', //...:*)", | ||
"placeHolder": "Which test to check for flakyness?" | ||
} | ||
} | ||
], | ||
"tasks": [ | ||
{ | ||
"label": "Configure with CMake", | ||
"type": "shell", | ||
"command": "cmake -B build -S . -DCMAKE_BUILD_TYPE=Debug", | ||
"group": "build" | ||
}, | ||
{ | ||
"label": "Build with CMake", | ||
"type": "shell", | ||
"command": "cmake --build build", | ||
"group": "build", | ||
"dependsOn": "Configure with CMake" | ||
}, | ||
{ | ||
"label": "Check for flakyness", | ||
"type": "bazel", | ||
"command": "test", | ||
"targets": [ | ||
"${input:pickFlakyTest}" | ||
], | ||
"options": [ | ||
"--runs_per_test=10" | ||
], | ||
}, | ||
{ | ||
"label": "Build Bazel Debug", | ||
"type": "bazel", | ||
"command": "build", | ||
"targets": [ | ||
"//:poly_map_test" | ||
], | ||
"group": "build" | ||
} | ||
] | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
coverage: | ||
precision: 2 | ||
round: down | ||
range: "100...100" | ||
status: | ||
project: true | ||
patch: true | ||
changes: true | ||
|
||
ignore: | ||
- 'tests/*' |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters