From 4645a1f8045fdc91ccea2fb8a09f222fd8f55bf9 Mon Sep 17 00:00:00 2001 From: Alexander Jung Date: Mon, 11 Dec 2023 12:52:34 +0100 Subject: [PATCH] feat(workflows): Introduce simple curl test to NGINX workflow Signed-off-by: Alexander Jung --- .github/workflows/library-nginx1.15.yaml | 27 ++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/.github/workflows/library-nginx1.15.yaml b/.github/workflows/library-nginx1.15.yaml index 9698b359..4a9cda22 100644 --- a/.github/workflows/library-nginx1.15.yaml +++ b/.github/workflows/library-nginx1.15.yaml @@ -47,6 +47,33 @@ jobs: arch: ${{ matrix.arch }} push: false output: oci://index.unikraft.io/unikraft.org/nginx:1.15 + after: | + # GitHub Actions can only executed with QEMU (via emulation mode) + if [[ ${{ matrix.plat }} != "qemu" ]]; then + exit 0; + fi + + export KRAFTKIT_RUNTIME_DIR=/github/workspace/.kraftkit + + set -xe; + + kraft run \ + --detach \ + --disable-acceleration \ + --plat ${{ matrix.plat }} \ + --arch ${{ matrix.arch }} \ + --name nginx-${GITHUB_RUN_ID} \ + --port 8080:80 \ + index.unikraft.io/unikraft.org/nginx:1.15 + + function cleanup { + kraft logs nginx-${GITHUB_RUN_ID} || true; + kraft rm nginx-${GITHUB_RUN_ID} || true; + } + trap cleanup EXIT + trap cleanup INT + + curl -Lv --fail http://localhost:8080 - name: Archive OCI digests uses: actions/upload-artifact@v3