Skip to content

Commit

Permalink
Build and distribute binaries
Browse files Browse the repository at this point in the history
  • Loading branch information
maxmouchet committed Oct 27, 2023
1 parent 194bce5 commit 4e622cc
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 12 deletions.
25 changes: 15 additions & 10 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ jobs:
- name: Install dependencies
run: |
sudo apt update
sudo apt install --yes build-essential cmake gcovr ninja-build python3-pip
sudo apt install --yes build-essential cmake gcovr python3-pip
pip3 install "conan<2.0"
- name: Configure project
run: cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS="-fprofile-arcs -ftest-coverage -fsanitize=address -fsanitize=undefined" -DWITH_CONAN=ON -DWITH_TESTS=ON
run: cmake -S . -B build -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS="-fprofile-arcs -ftest-coverage -fsanitize=address -fsanitize=undefined" -DWITH_CONAN=ON -DWITH_TESTS=ON
- name: Build tests
run: cmake --build build --target caracal-test
- name: Run tests
Expand All @@ -48,6 +48,12 @@ jobs:
- uses: codecov/codecov-action@v3

macos:
strategy:
matrix:
build_type: [Debug, Release]
include:
- build_type: Debug
cmake_opts: -DCMAKE_CXX_FLAGS="-fprofile-arcs -ftest-coverage -fsanitize=address -fsanitize=undefined"
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
Expand All @@ -56,16 +62,15 @@ jobs:
path: ~/.conan/data
key: ${{ runner.os }}-x86_64
- name: Install dependencies
run: brew install cmake gcovr ninja
run: brew install cmake gcovr
- name: Install Conan
run: pip3 install "conan<2.0"
- name: Configure project (try 1/2)
run: cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS="-fprofile-arcs -ftest-coverage -fsanitize=address -fsanitize=undefined" -DWITH_CONAN=ON -DWITH_TESTS=ON
continue-on-error: true
# For some unknown reasons bison fails to build on GitHub macOS 12 runners.
# However, if we call conan twice, it seems to work...¯\(◉‿◉)/¯
- name: Configure project (try 2/2)
run: cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS="-fprofile-arcs -ftest-coverage -fsanitize=address -fsanitize=undefined" -DWITH_CONAN=ON -DWITH_TESTS=ON
# For some unknown reasons bison fails to build on GitHub macOS 12 runners.
# However, if we call conan twice, it seems to work...¯\(◉‿◉)/¯
- name: Configure project
run: |
cmake -S . -B build -DWITH_BINARY=ON -DWITH_CONAN=ON -DWITH_TESTS=ON -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} ${{ matrix.cmake_opts }} || true
cmake -S . -B build -DWITH_BINARY=ON -DWITH_CONAN=ON -DWITH_TESTS=ON -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} ${{ matrix.cmake_opts }}
- name: Build tests
run: cmake --build build --target caracal-test
- name: Run tests
Expand Down
3 changes: 1 addition & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ RUN apt-get update && \
apt-get install --no-install-recommends --quiet --yes \
build-essential \
cmake \
ninja-build \
python3-pip && \
rm --force --recursive /var/lib/apt/lists/*

Expand All @@ -16,7 +15,7 @@ RUN python3 -m pip install --no-cache-dir build "conan>=1.35,<2.0"
WORKDIR /tmp
COPY . .

RUN cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DWITH_CONAN=ON -DWITH_BINARY=ON && \
RUN cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DWITH_CONAN=ON -DWITH_BINARY=ON && \
cmake --build build --target caracal-bin

# Main
Expand Down

0 comments on commit 4e622cc

Please sign in to comment.