Skip to content

Commit

Permalink
ci: add ci pipeline (#2)
Browse files Browse the repository at this point in the history
* ci: add ci pipeline and don't specify build type in CMake

* ci: use sudo for apt
  • Loading branch information
guuzaa authored Nov 10, 2024
1 parent 00d0df1 commit d8d5d0b
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM mcr.microsoft.com/devcontainers/cpp:1-ubuntu-22.04

# Optionally install the cmake for vcpkg
COPY ./package.sh /tmp/
COPY ./build_support/package.sh /tmp/

RUN chmod +x /tmp/package.sh \
&& /tmp/package.sh \
Expand Down
32 changes: 32 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: CI Pipeline

on:
push:
branches: [ main ]
pull_request:
types: [opened, synchronize]
branches: [ main ]

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Install Dependencies
run: |
chmod +x ./build_support/package.sh
./build_support/package.sh
- name: Configure CMake
run: cmake -B build -DCMAKE_BUILD_TYPE=Release

- name: Check Format
run: cmake --build build --target check-format

- name: Build
run: cmake --build build

- name: Test
run: cmake --build build -t test-lib
4 changes: 0 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,11 @@ add_subdirectory(${PROJECT_SOURCE_DIR}/src)
if(HAS_BENCHES)
include(3rdParty)
include_googletest()
set(CMAKE_BUILD_TYPE Release)
include_benchmark()
message(STATUS "Building benches")
add_subdirectory(benches)
endif(HAS_BENCHES)

# The below needs to be built in Debug mode
set(CMAKE_BUILD_TYPE Debug)

if(HAS_MSAN)
include(Sanitizers)
message(STATUS "Building Sanitizers")
Expand Down
4 changes: 2 additions & 2 deletions .devcontainer/package.sh → build_support/package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
#
set -e

apt-get -y update
sudo apt-get -y update

apt-get -y install \
sudo apt-get -y install \
build-essential \
clang-12 \
clang-format-12 \
Expand Down

0 comments on commit d8d5d0b

Please sign in to comment.