Skip to content

responding to bifurcation's change requests #137

responding to bifurcation's change requests

responding to bifurcation's change requests #137

Workflow file for this run

name: MLSPP CI
on:
push:
branches:
- main
pull_request:
branches:
- main
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
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:
name: Formatting Check
runs-on: ubuntu-latest
strategy:
matrix:
path:
- 'include'
- 'src'
- 'test'
- 'cmd'
- 'lib'
steps:
- uses: actions/checkout@v4
- name: Run clang-format style check for C/C++ programs
uses: jidicula/[email protected]
with:
clang-format-version: '16'
check-path: ${{ matrix.path }}
fallback-style: 'Mozilla'
quick-linux-interop-check:
needs: formatting-check
name: Quick Linux Check and Interop
runs-on: ubuntu-latest
steps:
# check out the repository recursively pulling the submodules
- name: Checkout repository and submodules
uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0
# write the commit hash of vcpkg to a text file so we can use it in the
# hashFiles for cache
- run: |
git -C ${{ env.VCPKG_REPO }} rev-parse HEAD > ${{ env.VCPG_COMMIT_HASH }}
- name: Dependencies (Ubuntu)
if: ${{ matrix.os == 'ubuntu-latest' }}
run: |
sudo apt-get install -y linux-headers-$(uname -r)
# First, attempt to pull key key, if that is not present, pull one of the
# restore-keys so we do not need to build from scratch.
# VCPKG-BinaryCache - description of cache
# v1 - provide a way to reset cache
# matrix.os - cache per OS and version
# hashFiles - Recache if the vcpkg files change
- name: Restore Cache
uses: actions/cache@v3
with:
path: ${{ github.workspace }}/build/cache
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="${{ env.TOOLCHAIN_FILE }}"
cmake --build "${{ env.CMAKE_BUILD_DIR }}" --target all --parallel 2
- name: Unit Test (OpenSSL 1.1)
run: |
cmake --build "${{ env.CMAKE_BUILD_DIR }}" --target test
- name: Build (Interop Harness)
run: |
cd cmd/interop
cmake -B build -DCMAKE_TOOLCHAIN_FILE="${{ env.TOOLCHAIN_FILE }}"
cmake --build build
- name: Test self-interop
run: |
make -C cmd/interop self-test
- name: Test interop on test vectors
run: |
make -C cmd/interop interop-test
- name: Test gRPC live interop with self
run: |
cd cmd/interop
./grpc-self-test.sh
- name: Build (OpenSSL 3)
run: |
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)
run: |
cmake --build "${{ env.CMAKE_BUILD_OPENSSL3_DIR }}" --target test
# recently, the oldest supported macos image was added to this matrix. This is
# to ensure backward compatibility on existing integrations. The goal is to
# have the newest and oldest OS's represented for macOs. Only using latest
# windows and linux images because they have not been an challenge.
platform-sanitizer-tests:
if: github.event.pull_request.draft == false
needs: quick-linux-interop-check
name: Build and test platforms using sanitizers and clang-tidy
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [windows-latest, ubuntu-latest, macos-latest]
include:
- os: windows-latest
ctest-target: RUN_TESTS
- os: ubuntu-latest
ctest-target: test
- os: macos-latest
ctest-target: test
- os: macos-latest
deployment_target: 10.11
ctest-target: test
steps:
- name: Checkout repository and submodules
uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0
# write the commit hash of vcpkg to a text file so we can use it in the
# hashFiles for cache
- run: |
git -C ${{ env.VCPKG_REPO }} rev-parse HEAD > ${{ env.VCPG_COMMIT_HASH }}
- name: Dependencies (macOs)
if: ${{ matrix.os == 'macos-latest' }}
run: |
brew install llvm pkg-config
ln -s "/usr/local/opt/llvm/bin/clang-format" "/usr/local/bin/clang-format"
ln -s "/usr/local/opt/llvm/bin/clang-tidy" "/usr/local/bin/clang-tidy"
- name: Dependencies (Ubuntu)
if: ${{ matrix.os == 'ubuntu-latest' }}
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("${{ 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="${{ env.TOOLCHAIN_FILE }}"
cmake --build "${{ env.CMAKE_BUILD_DIR }}" --parallel 2
- name: Unit Test (OpenSSL1.1)
run: |
cmake --build "${{ env.CMAKE_BUILD_DIR }}" --target "${{ matrix.ctest-target}}"
- name: Build (OpenSSL3)
run: |
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)
run: |
cmake --build "${{ env.CMAKE_BUILD_OPENSSL3_DIR }}" --target "${{ matrix.ctest-target}}"