Skip to content

CI improvements

CI improvements #77

Workflow file for this run

name: MLSPP CI
on:
push:
branches:
- main
pull_request:
branches:
- main
env:
CTEST_OUTPUT_ON_FAILURE: 1
CMAKE_GENERATOR: Ninja
CMAKE_TOOLCHAIN_FILE: ${{ github.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake
VCPKG_COMMIT_ID: 962e5e39f8a25f42522f51fffc574e05a3efd26b
jobs:
formatting-check:
name: Formatting Check
runs-on: ubuntu-latest
strategy:
matrix:
path:
- '.'
- 'cmd/interop'
steps:
- uses: actions/checkout@v3
- name: Run clang-format style check for C/C++ programs
uses: jidicula/[email protected]
with:
clang-format-version: '16'
check-path: ${{ matrix.path }}
include-regex: ${{ matrix.path }}\/(src|include|test|lib)\/.*\.(cpp|h)
quick-linux-interop-check:
needs: formatting-check
name: Quick Linux Check and Interop
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: lukka/get-cmake@latest
- name: Setup vcpkg
uses: lukka/run-vcpkg@v10
with:
vcpkgGitCommitId: ${{ env.VCPKG_COMMIT_ID }}
vcpkgDirectory: vcpkg
- name: Build (OpenSSL 1.1)
run: |
cmake -B build -DTESTING=ON
cmake --build build --target all
- name: Unit Test (OpenSSL 1.1)
run: |
cmake --build build --target test
- name: Build (Interop Harness)
run: |
cd cmd/interop
cmake -B build
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 build -DTESTING=ON -DVCPKG_MANIFEST_DIR="alternatives/openssl_3"
cmake --build build
- name: Unit Test (OpenSSL 3)
run: |
cmake --build build --target test
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
ossl3-vcpkg-dir: "alternatives\\openssl_3"
ctest-target: RUN_TESTS
- os: ubuntu-latest
ossl3-vcpkg-dir: "alternatives/openssl_3"
ctest-target: test
- os: macos-latest
ossl3-vcpkg-dir: "alternatives/openssl_3"
ctest-target: test
steps:
- uses: actions/checkout@v3
- uses: lukka/get-cmake@latest
- name: Setup vcpkg
uses: lukka/run-vcpkg@v10
with:
vcpkgGitCommitId: ${{ env.VCPKG_COMMIT_ID }}
vcpkgDirectory: vcpkg
- name: Build (OpenSSL 1.1)
run: |
cmake -B build -DTESTING=ON -DCLANG_TIDY=ON -DSANITIZERS=ON
cmake --build build
- name: Unit Test (OpenSSL 1.1)
run: |
cmake --build build --target "${{ matrix.ctest-target}}"
- name: Build (OpenSSL 3)
run: |
cmake -B build -DTESTING=ON -DCLANG_TIDY=ON -DSANITIZERS=ON -DVCPKG_MANIFEST_DIR="${{ matrix.ossl3-vcpkg-dir }}"
cmake --build build
- name: Unit Test (OpenSSL3)
run: |
cmake --build build --target "${{ matrix.ctest-target}}"
old-macos-compatibility:
if: github.event.pull_request.draft == false
needs: quick-linux-interop-check
name: Build for older macOS
runs-on: macos-latest
env:
MACOSX_DEPLOYMENT_TARGET: 10.11
steps:
- uses: actions/checkout@v3
- uses: lukka/get-cmake@latest
- name: Setup vcpkg
uses: lukka/run-vcpkg@v10
with:
vcpkgGitCommitId: ${{ env.VCPKG_COMMIT_ID }}
vcpkgDirectory: vcpkg
- name: Build
run: |
cmake -B build
cmake --build build --target mlspp