Skip to content

Commit

Permalink
Fix big in release. Fix CI for release.
Browse files Browse the repository at this point in the history
  • Loading branch information
MisterTea committed Aug 31, 2023
1 parent 2a63cd6 commit 384ca04
Show file tree
Hide file tree
Showing 5 changed files with 202 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ on:
push:
branches:
- master
- release
pull_request:

jobs:
Expand Down
81 changes: 81 additions & 0 deletions .github/workflows/novcpkg_build_release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
name: NoVcpkg Build
on:
push:
branches:
- release
pull_request:

jobs:
build_novcpkg:
name: build-novcpkg-${{ matrix.os }}-gcc${{ matrix.gcc }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
os: [ubuntu-latest, macos-latest]
gcc: [11, 12]
exclude:
- os: macos-latest
gcc: 11
- os: macos-latest
gcc: 12
env:
# Indicates the CMake build directory where project files and binaries are being produced.
CMAKE_BUILD_DIR: ${{ github.workspace }}/build

steps:
- name: Install Dependencies (Linux)
run: |
sudo apt-get update && \
sudo apt-get install --no-install-recommends \
libboost-dev \
libsodium-dev \
libncurses5-dev \
libprotobuf-dev \
protobuf-compiler \
libgflags-dev \
libutempter-dev \
build-essential \
ninja-build \
libcurl4-openssl-dev \
curl \
zip \
unzip \
tar \
cmake \
libutempter-dev \
libunwind-dev
if: matrix.os == 'ubuntu-latest'
- name: Install Dependencies (macOS)
run: brew update && brew install ninja cmake pkg-config curl openssl protobuf libsodium
if: matrix.os == 'macos-latest'

- uses: actions/checkout@v2
with:
submodules: false

# Run CMake to generate Ninja project files.
- name: Install dependencies and generate project files (mac)
run: |
OPENSSL_ROOT_DIR=`brew --prefix openssl` cmake -S "${{ github.workspace }}" -B "${{ env.CMAKE_BUILD_DIR }}" -GNinja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DDISABLE_VCPKG=ON -DOPENSSL_ROOT_DIR=$OPENSSL_ROOT_DIR
if: matrix.os == 'macos-latest'
- name: Install dependencies and generate project files (linux)
env:
CC: gcc-${{ matrix.gcc }}
CXX: g++-${{ matrix.gcc }}
run: |
cmake -S "${{ github.workspace }}" -B "${{ env.CMAKE_BUILD_DIR }}" -GNinja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DDISABLE_VCPKG=ON -DOPENSSL_ROOT_DIR=$OPENSSL_ROOT_DIR
if: matrix.os == 'ubuntu-latest'
- name: Install dependencies and generate project files (windows)
run: |
cmake -S "${{ github.workspace }}" -B "${{ env.CMAKE_BUILD_DIR }}" -GNinja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DDISABLE_VCPKG=ON -DOPENSSL_ROOT_DIR=$OPENSSL_ROOT_DIR
if: matrix.os == 'windows-latest'
# Build the whole project with Ninja (which is spawn by CMake).
- name: Build
run: |
cmake --build "${{ env.CMAKE_BUILD_DIR }}"
- uses: actions/upload-artifact@v2
with:
name: et-client-${{matrix.os}}
path: ${{ env.CMAKE_BUILD_DIR }}/et${{matrix.extension}}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ on:
push:
branches:
- master
- release
pull_request:

jobs:
Expand Down
117 changes: 117 additions & 0 deletions .github/workflows/vcpkg_build_release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
name: Vcpkg Build
on:
push:
branches:
- release
pull_request:

jobs:
build_vcpkg:
name: build-vcpkg-${{ matrix.os }}-${{ matrix.gcc }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
gcc: [11, 12]
include:
- os: windows-latest
extension: .exe
exclude:
- os: macos-latest
gcc: 11
- os: macos-latest
gcc: 12
- os: windows-latest
gcc: 11
- os: windows-latest
gcc: 12
env:
# Indicates the CMake build directory where project files and binaries are being produced.
CMAKE_BUILD_DIR: ${{ github.workspace }}/build
# Indicates the location of the vcpkg as a Git submodule of the project repository.
VCPKG_ROOT: ${{ github.workspace }}/external/vcpkg

steps:
- name: Install Dependencies (Linux)
run: |
sudo apt-get update && \
sudo apt-get install --no-install-recommends \
libboost-dev \
libsodium-dev \
libncurses5-dev \
libprotobuf-dev \
protobuf-compiler \
libgflags-dev \
libutempter-dev \
build-essential \
ninja-build \
libcurl4-openssl-dev \
curl \
zip \
unzip \
tar \
cmake \
libutempter-dev \
libunwind-dev
if: matrix.os == 'ubuntu-latest'
- name: Install Dependencies (Windows)
run: choco install ninja
if: matrix.os == 'windows-latest'
- name: Install Dependencies (macOS)
run: brew update && brew install ninja cmake
if: matrix.os == 'macos-latest'

- uses: actions/checkout@v2
with:
submodules: false

# Restore both vcpkg and its artifacts from the GitHub cache service.
- name: Restore vcpkg and its artifacts.
uses: actions/cache@v2
with:
path: |
${{ env.VCPKG_ROOT }}
!${{ env.VCPKG_ROOT }}/buildtrees
!${{ env.VCPKG_ROOT }}/packages
!${{ env.VCPKG_ROOT }}/downloads
# The key is composed in a way that it gets properly invalidated: this must happen whenever vcpkg's Git commit id changes, or the list of packages changes. In this case a cache miss must happen and a new entry with a new key with be pushed to GitHub the cache service.
# The key includes: hash of the vcpkg.json file, the hash of the vcpkg Git commit id, and the used vcpkg's triplet. The vcpkg's commit id would suffice, but computing an hash out it does not harm.
# Note: given a key, the cache content is immutable. If a cache entry has been created improperly, in order the recreate the right content the key must be changed as well, and it must be brand new (i.e. not existing already).
key: |
et-2-vcpkg-${{ hashFiles( 'vcpkg.json' ) }}-${{ hashFiles( '.git/modules/external/vcpkg/HEAD' )}}-${{ matrix.os }}
- name: Show content of workspace after cache has been restored
run: find $RUNNER_WORKSPACE
shell: bash

# On Windows runners, let's ensure to have the Developer Command Prompt environment setup correctly. As used here the Developer Command Prompt created is targeting x64 and using the default the Windows SDK.
- uses: ilammy/msvc-dev-cmd@v1
# Run CMake to generate Ninja project files, using the vcpkg's toolchain file to resolve and install the dependencies as specified in vcpkg.json.
- name: Install dependencies and generate project files (linux)
env:
CC: gcc-${{ matrix.gcc }}
CXX: g++-${{ matrix.gcc }}
run: |
cmake -S "${{ github.workspace }}" -B "${{ env.CMAKE_BUILD_DIR }}" -GNinja -DCMAKE_BUILD_TYPE=RelWithDebInfo
if: matrix.os == 'ubuntu-latest'
- name: Install dependencies and generate project files (mac)
env:
CC: gcc-${{ matrix.gcc }}
CXX: g++-${{ matrix.gcc }}
run: |
cmake -S "${{ github.workspace }}" -B "${{ env.CMAKE_BUILD_DIR }}" -GNinja -DCMAKE_BUILD_TYPE=RelWithDebInfo
if: matrix.os == 'macos-latest'
- name: Install dependencies and generate project files (windows)
run: |
cmake -S "${{ github.workspace }}" -B "${{ env.CMAKE_BUILD_DIR }}" -GNinja -DCMAKE_BUILD_TYPE=RelWithDebInfo
if: matrix.os == 'windows-latest'
# Build the whole project with Ninja (which is spawn by CMake).
- name: Build
run: |
cmake --build "${{ env.CMAKE_BUILD_DIR }}"
- uses: actions/upload-artifact@v2
with:
name: et-client-${{matrix.os}}
path: ${{ env.CMAKE_BUILD_DIR }}/et${{matrix.extension}}
8 changes: 4 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,10 @@ find_package(ZLIB REQUIRED)
find_package(Unwind)

if(DISABLE_VCPKG)
add_subdirectory(external/Catch2)
add_subdirectory(external/cxxopts)
add_subdirectory(external/cpp-httplib)
add_subdirectory(external/json)
add_subdirectory(${EXTERNAL_DIR}/Catch2)
add_subdirectory(${EXTERNAL_DIR}/cxxopts)
add_subdirectory(${EXTERNAL_DIR}/cpp-httplib)
add_subdirectory(${EXTERNAL_DIR}/json)
include_directories(
${EXTERNAL_DIR}/cpp-httplib
${EXTERNAL_DIR}/simpleini
Expand Down

0 comments on commit 384ca04

Please sign in to comment.