Skip to content

Commit

Permalink
responding to bifurcation's change requests
Browse files Browse the repository at this point in the history
  • Loading branch information
Greg Hewett committed Oct 21, 2023
1 parent 07adb24 commit 320fd6c
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 30 deletions.
47 changes: 26 additions & 21 deletions .github/workflows/main_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,16 @@ on:
env:
CTEST_OUTPUT_ON_FAILURE: 1
CMAKE_BUILD_DIR: ${{ github.workspace }}/build
CMAKE_TEST_DIR: ${{ github.workspace }}/build/test
CMAKE_BUILD_OPENSSL3_DIR: ${{ github.workspace }}/build_openssl3
CMAKE_TEST_OPENSSL3_DIR: ${{ github.workspace }}/build_openssl3/test
CMAKE_TEST_DIR: ${{ github.workspace }}/build/test
VCPKG_BINARY_SOURCES: files,${{ github.workspace }}/build/cache,readwrite
TOOLCHAIN_FILE: ${{ github.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake
OPENSSL3_MANIFEST_DIR: ${{ github.workspace }}/alternatives/openssl_3
DEFAULT_VCPKG_CONFIG: ${{ github.workspace }}/vcpkg.json
OPENSSL3_VCPKG_CONFIG: ${{ github.workspace }}/alternatives/openssl_3/vcpkg.json
VCPKG_REPO: ${{ github.workspace }}/vcpkg
VCPG_COMMIT_HASH: ${{ github.workspace }}/vcpkg_commit.txt

jobs:
formatting-check:
Expand Down Expand Up @@ -42,9 +48,10 @@ jobs:
needs: formatting-check
name: Quick Linux Check and Interop
runs-on: ubuntu-latest

steps:

# check out the repository with recursively pulling the submodules
# check out the repository recursively pulling the submodules
- name: Checkout repository and submodules
uses: actions/checkout@v4
with:
Expand All @@ -54,7 +61,7 @@ jobs:
# write the commit hash of vcpkg to a text file so we can use it in the
# hashFiles for cache
- run: |
git -C vcpkg rev-parse HEAD > vcpkg-commit.txt
git -C ${{ env.VCPKG_REPO }} rev-parse HEAD > ${{ env.VCPG_COMMIT_HASH }}
- name: Dependencies (Ubuntu)
if: ${{ matrix.os == 'ubuntu-latest' }}
Expand All @@ -71,14 +78,14 @@ jobs:
uses: actions/cache@v3
with:
path: ${{ github.workspace }}/build/cache
key: VCPKG-BinaryCache-ubuntu-latest-v1-${{ hashFiles('vcpkg-commit.txt', 'vcpkg.json', 'alternatives/openssl_3/vcpkg.json') }}
key: VCPKG-BinaryCache-ubuntu-latest-v1-${{ hashFiles("${{ env.VCPG_COMMIT_HASH }}", "${{ env.DEFAULT_VCPKG_CONFIG }}", "${{ env.OPENSSL3_VCPKG_CONFIG }}") }}
restore-keys: |
VCPKG-BinaryCache-ubuntu-latest-v1
VCPKG-BinaryCache-ubuntu-latest
- name: Build (OpenSSL 1.1)
run: |
cmake -B "${{ env.CMAKE_BUILD_DIR }}" -DTESTING=ON -DCMAKE_TOOLCHAIN_FILE="vcpkg/scripts/buildsystems/vcpkg.cmake"
cmake -B "${{ env.CMAKE_BUILD_DIR }}" -DTESTING=ON -DCMAKE_TOOLCHAIN_FILE="${{ env.TOOLCHAIN_FILE }}"
cmake --build "${{ env.CMAKE_BUILD_DIR }}" --target all --parallel 2
- name: Unit Test (OpenSSL 1.1)
Expand All @@ -88,7 +95,7 @@ jobs:
- name: Build (Interop Harness)
run: |
cd cmd/interop
cmake -B build -DCMAKE_TOOLCHAIN_FILE="../../vcpkg/scripts/buildsystems/vcpkg.cmake"
cmake -B build -DCMAKE_TOOLCHAIN_FILE="${{ env.TOOLCHAIN_FILE }}"
cmake --build build
- name: Test self-interop
Expand All @@ -106,7 +113,7 @@ jobs:
- name: Build (OpenSSL 3)
run: |
cmake -B "${{ env.CMAKE_BUILD_OPENSSL3_DIR }}" -DTESTING=ON -DVCPKG_MANIFEST_DIR="alternatives/openssl_3" -DCMAKE_TOOLCHAIN_FILE="vcpkg/scripts/buildsystems/vcpkg.cmake"
cmake -B "${{ env.CMAKE_BUILD_OPENSSL3_DIR }}" -DTESTING=ON -DVCPKG_MANIFEST_DIR="${{ env.OPENSSL3_MANIFEST_DIR }}" -DCMAKE_TOOLCHAIN_FILE="${{ env.TOOLCHAIN_FILE }}"
cmake --build "${{ env.CMAKE_BUILD_OPENSSL3_DIR }}"
- name: Unit Test (OpenSSL 3)
Expand All @@ -125,23 +132,16 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [windows-latest, ubuntu-latest, macos-latest, macos-11]
os: [windows-latest, ubuntu-latest, macos-latest]
include:
- os: windows-latest
vcpkg-cmake-file: "vcpkg\\scripts\\buildsystems\\vcpkg.cmake"
ossl3-vcpkg-dir: "alternatives\\openssl_3"
ctest-target: RUN_TESTS
- os: ubuntu-latest
vcpkg-cmake-file: "vcpkg/scripts/buildsystems/vcpkg.cmake"
ossl3-vcpkg-dir: "alternatives/openssl_3"
ctest-target: test
- os: macos-latest
vcpkg-cmake-file: "vcpkg/scripts/buildsystems/vcpkg.cmake"
ossl3-vcpkg-dir: "alternatives/openssl_3"
ctest-target: test
- os: macos-11
vcpkg-cmake-file: "vcpkg/scripts/buildsystems/vcpkg.cmake"
ossl3-vcpkg-dir: "alternatives/openssl_3"
- os: macos-latest
deployment_target: 10.11
ctest-target: test

steps:
Expand All @@ -154,7 +154,7 @@ jobs:
# write the commit hash of vcpkg to a text file so we can use it in the
# hashFiles for cache
- run: |
git -C vcpkg rev-parse HEAD > vcpkg-commit.txt
git -C ${{ env.VCPKG_REPO }} rev-parse HEAD > ${{ env.VCPG_COMMIT_HASH }}
- name: Dependencies (macOs)
if: ${{ matrix.os == 'macos-latest' }}
Expand All @@ -168,18 +168,23 @@ jobs:
run: |
sudo apt-get install -y linux-headers-$(uname -r)
- name: Set Deployment Target
if: ${{ matrix.os == 'macos-latest' && matrix.deployment_target }}
env:
MACOSX_DEPLOYMENT_TARGET: ${{ matrix.deployment_target }}

- name: Restore Cache
uses: actions/cache@v3
with:
path: ${{ github.workspace }}/build/cache
key: VCPKG-BinaryCache-${{ matrix.os }}-v1-${{ hashFiles('vcpkg-commit.txt', 'vcpkg.json', 'alternatives/openssl_3/vcpkg.json') }}
key: VCPKG-BinaryCache-${{ matrix.os }}-v1-${{ hashFiles("${{ env.VCPG_COMMIT_HASH }}", "${{ env.DEFAULT_VCPKG_CONFIG }}", "${{ env.OPENSSL3_VCPKG_CONFIG }}") }}
restore-keys: |
VCPKG-BinaryCache-${{ matrix.os }}-v1
VCPKG-BinaryCache-${{ matrix.os }}
- name: Build (OpenSSL1.1)
run: |
cmake -B "${{ env.CMAKE_BUILD_DIR }}" -DTESTING=ON -DCLANG_TIDY=ON -DSANITIZERS=ON -DCMAKE_TOOLCHAIN_FILE="${{ matrix.vcpkg-cmake-file}}"
cmake -B "${{ env.CMAKE_BUILD_DIR }}" -DTESTING=ON -DCLANG_TIDY=ON -DSANITIZERS=ON -DCMAKE_TOOLCHAIN_FILE="${{ env.TOOLCHAIN_FILE }}"
cmake --build "${{ env.CMAKE_BUILD_DIR }}" --parallel 2
- name: Unit Test (OpenSSL1.1)
Expand All @@ -188,7 +193,7 @@ jobs:
- name: Build (OpenSSL3)
run: |
cmake -B "${{ env.CMAKE_BUILD_OPENSSL3_DIR }}" -DTESTING=ON -DCLANG_TIDY=ON -DSANITIZERS=ON -DVCPKG_MANIFEST_DIR="${{ matrix.ossl3-vcpkg-dir }}" -DCMAKE_TOOLCHAIN_FILE="${{ matrix.vcpkg-cmake-file}}"
cmake -B "${{ env.CMAKE_BUILD_OPENSSL3_DIR }}" -DTESTING=ON -DCLANG_TIDY=ON -DSANITIZERS=ON -DVCPKG_MANIFEST_DIR="${{ env.OPENSSL3_MANIFEST_DIR }}" -DCMAKE_TOOLCHAIN_FILE="${{ env.TOOLCHAIN_FILE }}"
cmake --build "${{ env.CMAKE_BUILD_OPENSSL3_DIR }}"
- name: Unit Test (OpenSSL3)
Expand Down
14 changes: 5 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,17 @@ all: ${BUILD_DIR}
${BUILD_DIR}: CMakeLists.txt test/CMakeLists.txt
cmake -B${BUILD_DIR} .

vcpkg:
${TOOLCHAIN_FILE}:
git submodule update --init --recursive

dev:
dev: ${TOOLCHAIN_FILE}
# Only enable testing, not clang-tidy/sanitizers; the latter make the build
# too slow, and we can run them in CI
cmake -B${BUILD_DIR} -DTESTING=ON -DCMAKE_BUILD_TYPE=Debug .
cmake -B${BUILD_DIR} -DTESTING=ON -DCMAKE_BUILD_TYPE=Debug -DCMAKE_TOOLCHAIN_FILE=${TOOLCHAIN_FILE} -DVCPKG_BUILD_TYPE=release

vcpkg-dev: vcpkg
# Like `dev`, but retrieve dependencies using vcpkg
cmake -B${BUILD_DIR} -DTESTING=ON -DCMAKE_BUILD_TYPE=Debug -DCMAKE_TOOLCHAIN_FILE=${TOOLCHAIN_FILE}

dev3: vcpkg
dev3: ${TOOLCHAIN_FILE}
# Like `dev`, but using OpenSSL 3
cmake -B${BUILD_DIR} -DTESTING=ON -DCMAKE_BUILD_TYPE=Debug -DCMAKE_TOOLCHAIN_FILE=${TOOLCHAIN_FILE} -DVCPKG_MANIFEST_DIR=${OPENSSL3_MANIFEST} .
cmake -B${BUILD_DIR} -DTESTING=ON -DCMAKE_BUILD_TYPE=Debug -DCMAKE_TOOLCHAIN_FILE=${TOOLCHAIN_FILE} -DVCPKG_MANIFEST_DIR=${OPENSSL3_MANIFEST} -DVCPKG_BUILD_TYPE=release

test: ${BUILD_DIR} test/*
cmake --build ${BUILD_DIR} --target mlspp_test
Expand Down

0 comments on commit 320fd6c

Please sign in to comment.