Skip to content

CI Cleanup

CI Cleanup #204

Workflow file for this run

name: MLSPP CI
on:
push:
branches:
- main
pull_request:
branches:
- main
env:
CMAKE_BUILD_PARALLEL_LEVEL: 3
CTEST_OUTPUT_ON_FAILURE: 1
CMAKE_BUILD_DIR: ${{ github.workspace }}/build
CMAKE_BUILD_OPENSSL3_DIR: ${{ github.workspace }}/build_openssl3
CMAKE_BUILD_BORINGSSL_DIR: ${{ github.workspace }}/build_boringssl
VCPKG_BINARY_SOURCES: files,${{ github.workspace }}/build/cache,readwrite
CMAKE_TOOLCHAIN_FILE: ${{ github.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake
VCPKG_REPO: ${{ github.workspace }}/vcpkg
CACHE_VERSION: v01
CACHE_NAME: vcpkg
jobs:
# formatting-check:
# name: Formatting Check
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4
#
# - name: Run clang-format style check for C/C++ programs
# uses: jidicula/[email protected]
# with:
# clang-format-version: 16
# include-regex: '^\./(src|include|test|cmd)/.*\.(cpp|h)$'
# fallback-style: 'Mozilla'
#
platform-sanitizer-tests:
# needs: formatting-check
name: Build and test
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
steps:
- name: Checkout repository and submodules
uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0
- run: |
git -C ${{ env.VCPKG_REPO }} rev-parse HEAD > vcpkg_commit.txt
- name: Restore Cache
uses: actions/cache@v3
with:
path: ${{ github.workspace }}/build/cache
key: ${{ env.CACHE_VERSION }}-${{ env.CACHE_NAME }}-${{ matrix.os }}-${{ hashFiles('vcpkg_commit.txt', 'alternatives/*/vcpkg.json') }}
restore-keys: |
${{ env.CACHE_VERSION }}-${{ env.CACHE_NAME }}-${{ matrix.os }}
- name: Dependencies (macOs)
if: ${{ matrix.os == 'macos-latest' }}
run: |
brew install llvm pkg-config nasm
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) nasm
- name: Build (OpenSSL 1.1)
run: |
cmake -B "${{ env.CMAKE_BUILD_DIR }}" -DTESTING=ON -DCLANG_TIDY=ON -DSANITIZERS=ON -DVCPKG_MANIFEST_DIR="alternatives/openssl_1.1"
cmake --build "${{ env.CMAKE_BUILD_DIR }}"
- name: Unit Test (OpenSSL 1.1)
run: |
cmake --build "${{ env.CMAKE_BUILD_DIR }}" --target "${{ matrix.ctest-target}}"
- name: Build (OpenSSL 3)
run: |
cmake -B "${{ env.CMAKE_BUILD_OPENSSL3_DIR }}" -DTESTING=ON -DCLANG_TIDY=ON -DSANITIZERS=ON -DVCPKG_MANIFEST_DIR="alternatives/openssl_3"
cmake --build "${{ env.CMAKE_BUILD_OPENSSL3_DIR }}"
- name: Unit Test (OpenSSL 3)
run: |
cmake --build "${{ env.CMAKE_BUILD_OPENSSL3_DIR }}" --target "${{ matrix.ctest-target}}"
- name: Build (BoringSSL)
run: |
cmake -B "${{ env.CMAKE_BUILD_BORINGSSL_DIR }}" -DTESTING=ON -DCLANG_TIDY=ON -DSANITIZERS=ON -DVCPKG_MANIFEST_DIR="alternatives/boringssl"
cmake --build "${{ env.CMAKE_BUILD_BORINGSSL_DIR }}"
- name: Unit Test (BoringSSL)
run: |
cmake --build "${{ env.CMAKE_BUILD_BORINGSSL_DIR }}" --target "${{ matrix.ctest-target}}"
# TODO: Add the legacy macOS build to the main matrix
# TODO: Add a clang-tidy build