diff --git a/.github/workflows/main_ci.yml b/.github/workflows/main_ci.yml index 9a7841f1..57f75333 100644 --- a/.github/workflows/main_ci.yml +++ b/.github/workflows/main_ci.yml @@ -4,9 +4,17 @@ on: push: branches: - main + paths: + - ".github/**" + - "**.cpp" + - "**.h" pull_request: branches: - main + paths: + - ".github/**" + - "**.cpp" + - "**.h" env: CMAKE_BUILD_PARALLEL_LEVEL: 3 @@ -15,8 +23,33 @@ env: CMAKE_TOOLCHAIN_FILE: ${{ github.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake jobs: + choose_crypto_matrix: + name: Choose crypto libraries to test with + runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.set-matrix.outputs.matrix }} + steps: + - uses: dorny/paths-filter@v3 + id: filterV + with: + filters: | + hpke: + - 'lib/hpke/include/**' + - 'lib/hpke/src/**' + - 'lib/hpke/test/**' + + - id: set-matrix + run: | + if [ ${{ steps.filter.outputs.hpke }} = "true" ]; + then + echo "matrix=[\"openssl_1.1\",\"openssl_3\",\"boringssl\"]" >> $GITHUB_OUTPUT; + else + echo "matrix=[\"openssl_3\"]" >> $GITHUB_OUTPUT + fi + formatting-check: name: Formatting Check + needs: choose_crypto_matrix runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -29,13 +62,13 @@ jobs: fallback-style: 'Mozilla' build-and-unit-test: - needs: formatting-check + needs: [formatting-check, choose_crypto_matrix] name: Build and test runs-on: ${{ matrix.os }} strategy: matrix: os: [windows-latest, ubuntu-latest, macos-latest] - crypto: [openssl_1.1, openssl_3, boringssl] + crypto: ${{ fromJson(needs.choose_crypto_matrix.outputs.matrix )}} env: CRYPTO_DIR: "./alternatives/${{ matrix.crypto }}" @@ -108,12 +141,12 @@ jobs: clang-tidy: if: github.event.pull_request.draft == false - needs: build-and-unit-test + needs: [build-and-unit-test, choose_crypto_matrix] name: Build with clang-tidy runs-on: ubuntu-latest strategy: matrix: - crypto: [openssl_1.1, openssl_3, boringssl] + crypto: ${{ fromJson(needs.choose_crypto_matrix.outputs.matrix )}} env: CRYPTO_DIR: "./alternatives/${{ matrix.crypto }}"