Skip to content

Commit

Permalink
Merge branch 'main' into windows-hang
Browse files Browse the repository at this point in the history
  • Loading branch information
bifurcation committed Dec 15, 2023
2 parents b7cc914 + 43b3cb4 commit 38f07c5
Show file tree
Hide file tree
Showing 3 changed files with 108 additions and 111 deletions.
210 changes: 105 additions & 105 deletions .github/workflows/main_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,114 +15,114 @@ env:
CMAKE_TOOLCHAIN_FILE: ${{ github.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake

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'

build-and-unit-test:
needs: formatting-check
name: Build and test
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-latest, ubuntu-latest, macos-latest]
crypto: [openssl_1.1, openssl_3, boringssl]

env:
BUILD_DIR: "${RUNNER_TEMP}/build_${{ matrix.crypto }}"
CRYPTO_DIR: "./alternatives/${{ matrix.crypto }}"

steps:
- uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0

- uses: ./.github/actions/prepare-build
with:
os: ${{ matrix.os }}
crypto: ${{ matrix.crypto }}
cache-dir: ${{ github.workspace }}/vcpkg_cache

- name: Build
run: |
cmake -B "${{ env.BUILD_DIR }}" -DVCPKG_MANIFEST_DIR="${{ env.CRYPTO_DIR }}" -DTESTING=ON
cmake --build "${{ env.BUILD_DIR }}"
- name: Unit Test (non-Windows)
if: matrix.os != 'windows-latest'
run: |
cmake --build "${{ env.BUILD_DIR }}" --target test
# XXX(RLB): Unit tests are currently disabled on Windows because of two
# conflicting bugs. On the one hand, doctest has a bug that causes
# doctest_discover_tests to fail when tests are built with sanitizers. On the
# other hand, if tests are not built with sanitizers, then the unit tests hang
# in the middle of the test run.
#
# - name: Unit Test (Windows)
# if: matrix.os == 'windows-latest'
# 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'
#
# build-and-unit-test:
# needs: formatting-check
# name: Build and test
# runs-on: ${{ matrix.os }}
# strategy:
# matrix:
# os: [windows-latest, ubuntu-latest, macos-latest]
# crypto: [openssl_1.1, openssl_3, boringssl]
#
# env:
# BUILD_DIR: "${RUNNER_TEMP}/build_${{ matrix.crypto }}"
# CRYPTO_DIR: "./alternatives/${{ matrix.crypto }}"
#
# steps:
# - uses: actions/checkout@v4
# with:
# submodules: recursive
# fetch-depth: 0
#
# - uses: ./.github/actions/prepare-build
# with:
# os: ${{ matrix.os }}
# crypto: ${{ matrix.crypto }}
# cache-dir: ${{ github.workspace }}/vcpkg_cache
#
# - name: Build
# run: |
# cmake --build "${{ env.BUILD_DIR }}" --target RUN_TESTS

interop-test:
if: github.event.pull_request.draft == false
needs: build-and-unit-test
name: Interop test
runs-on: ubuntu-latest

env:
BUILD_DIR: "${RUNNER_TEMP}/build_openssl_1.1"
CRYPTO_DIR: "./alternatives/openssl_1.1"

steps:
- uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0

- uses: ./.github/actions/prepare-build
with:
os: ubuntu-latest
crypto-dir: openssl_1.1
cache-dir: ${{ github.workspace }}/vcpkg_cache

- name: Build
run: |
cmake -B "${{ env.BUILD_DIR }}" -DVCPKG_MANIFEST_DIR="${{ env.CRYPTO_DIR }}"
cmake --build "${{ env.BUILD_DIR }}"
- 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
# cmake -B "${{ env.BUILD_DIR }}" -DVCPKG_MANIFEST_DIR="${{ env.CRYPTO_DIR }}" -DTESTING=ON
# cmake --build "${{ env.BUILD_DIR }}"
#
# - name: Unit Test (non-Windows)
# if: matrix.os != 'windows-latest'
# run: |
# cmake --build "${{ env.BUILD_DIR }}" --target test
#
## XXX(RLB): Unit tests are currently disabled on Windows because of two
## conflicting bugs. On the one hand, doctest has a bug that causes
## doctest_discover_tests to fail when tests are built with sanitizers. On the
## other hand, if tests are not built with sanitizers, then the unit tests hang
## in the middle of the test run.
##
## - name: Unit Test (Windows)
## if: matrix.os == 'windows-latest'
## run: |
## cmake --build "${{ env.BUILD_DIR }}" --target RUN_TESTS
#
# interop-test:
# if: github.event.pull_request.draft == false
# needs: build-and-unit-test
# name: Interop test
# runs-on: ubuntu-latest
#
# env:
# BUILD_DIR: "${RUNNER_TEMP}/build_openssl_1.1"
# CRYPTO_DIR: "./alternatives/openssl_1.1"
#
# steps:
# - uses: actions/checkout@v4
# with:
# submodules: recursive
# fetch-depth: 0
#
# - uses: ./.github/actions/prepare-build
# with:
# os: ubuntu-latest
# crypto-dir: openssl_1.1
# cache-dir: ${{ github.workspace }}/vcpkg_cache
#
# - name: Build
# run: |
# cmake -B "${{ env.BUILD_DIR }}" -DVCPKG_MANIFEST_DIR="${{ env.CRYPTO_DIR }}"
# cmake --build "${{ env.BUILD_DIR }}"
#
# - 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
#
clang-tidy:
if: github.event.pull_request.draft == false
needs: build-and-unit-test
# needs: build-and-unit-test
name: Build with clang-tidy
runs-on: ubuntu-latest
strategy:
Expand Down
3 changes: 0 additions & 3 deletions lib/hpke/test/certificate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@
#include <iostream>
#include <vector>

#include <tls/compat.h>
namespace opt = MLS_NAMESPACE::tls::opt;

TEST_CASE("Certificate Known-Answer depth 2")
{
// TODO(suhas) Do this for each supported signature algorithm
Expand Down
6 changes: 3 additions & 3 deletions test/credential.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ TEST_CASE("X509 Credential Depth 2")

auto cred = Credential::x509(der_in);
auto x509 = cred.get<X509Credential>();
CHECK(x509.public_key().data.size() != 0);
CHECK(!x509.public_key().data.empty());

const auto& x509_original = cred.get<X509Credential>();
CHECK(x509.der_chain == x509_original.der_chain);
Expand Down Expand Up @@ -167,7 +167,7 @@ TEST_CASE("X509 Credential Depth 2 Marshal/Unmarshal")

auto original = Credential::x509(der_in);
const auto& x509_original = original.get<X509Credential>();
CHECK(x509_original.public_key().data.size() != 0);
CHECK(!x509_original.public_key().data.empty());

auto marshalled = tls::marshal(original);
auto unmarshaled = tls::get<Credential>(marshalled);
Expand All @@ -193,7 +193,7 @@ TEST_CASE("X509 Credential Depth 1 Marshal/Unmarshal")

auto original = Credential::x509(der_in);
auto x509_original = original.get<X509Credential>();
CHECK(x509_original.public_key().data.size() != 0);
CHECK(!x509_original.public_key().data.empty());

auto marshalled = tls::marshal(original);
auto unmarshaled = tls::get<Credential>(marshalled);
Expand Down

0 comments on commit 38f07c5

Please sign in to comment.