From 55e675dfc6ef4a4e3309de6f6dc6094a0c9a2da7 Mon Sep 17 00:00:00 2001 From: Alex Bozarth Date: Mon, 25 Nov 2024 12:41:34 -0600 Subject: [PATCH] Add nginx workflow and generic curl tests Signed-off-by: Alex Bozarth --- .github/workflows/curl.yml | 17 +++++++-- .github/workflows/nginx.yml | 70 +++++++++++++++++++++++++++++++++++++ 2 files changed, 85 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/nginx.yml diff --git a/.github/workflows/curl.yml b/.github/workflows/curl.yml index 29da7c7..b64c004 100644 --- a/.github/workflows/curl.yml +++ b/.github/workflows/curl.yml @@ -62,6 +62,19 @@ jobs: target: dev tags: oqs-curl-dev - - name: Test curl + - name: Build the Docker image (with generic liboqs) + uses: docker/build-push-action@v6 + with: + load: true + context: curl + platforms: ${{ matrix.platform }} + build-args: | + MAKE_DEFINES=-j4 + LIBOQS_BUILD_DEFINES="-DOQS_OPT_TARGET=generic" + ${{ (github.event.inputs.build_main == 'true') && env.build-args || null }} + tags: oqs-curl-generic + + - name: Test curl and curl generic run: | - docker run -e TEST_TIME=5 -e KEM_ALG=kyber768 -e SIG_ALG=dilithium3 oqs-curl perftest.sh + docker run -e TEST_TIME=5 -e KEM_ALG=kyber768 -e SIG_ALG=dilithium3 oqs-curl perftest.sh && + docker run -e TEST_TIME=5 -e KEM_ALG=kyber768 -e SIG_ALG=dilithium3 oqs-curl-generic perftest.sh diff --git a/.github/workflows/nginx.yml b/.github/workflows/nginx.yml new file mode 100644 index 0000000..117efff --- /dev/null +++ b/.github/workflows/nginx.yml @@ -0,0 +1,70 @@ +name: Build & Test - nginx + +on: + push: + branches: [ 'main' ] + paths: ['.github/workflows/nginx.yml', 'nginx/**'] + pull_request: + branches: [ 'main' ] + paths: ['.github/workflows/nginx.yml', 'nginx/**'] + workflow_dispatch: + inputs: + build_main: + description: "Build using liboqs and oqsprovider main branches" + required: false + default: false + type: boolean + +env: + build-args: | + LIBOQS_TAG=main + OQSPROVIDER_TAG=main + +jobs: + build: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + platform: + - linux/amd64 + - linux/arm64 + steps: + - uses: actions/checkout@v3 + - uses: docker/setup-qemu-action@v3 + - uses: docker/setup-buildx-action@v3 + - uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build the Docker image + uses: docker/build-push-action@v6 + with: + load: true + context: nginx + platforms: ${{ matrix.platform }} + build-args: | + MAKE_DEFINES=-j4 + ${{ (github.event.inputs.build_main == 'true') && env.build-args || null }} + tags: oqs-nginx + + - name: Build the curl Docker image (with generic liboqs) + uses: docker/build-push-action@v6 + with: + load: true + context: curl + platforms: ${{ matrix.platform }} + build-args: | + MAKE_DEFINES=-j4 + LIBOQS_BUILD_DEFINES="-DOQS_OPT_TARGET=generic" + ${{ (github.event.inputs.build_main == 'true') && env.build-args || null }} + tags: oqs-curl-generic + + - name: Test nginx with curl generic + run: | + docker network create nginx-test && + docker run --network nginx-test --detach --rm --name oqs-nginx oqs-nginx && + sleep 2 && + docker run --network nginx-test oqs-curl-generic curl -k https://oqs-nginx:4433