From 1c879ce89be9ca08911d04faf2445e886978af93 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 | 28 ++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/.github/workflows/library-nginx1.15.yaml b/.github/workflows/library-nginx1.15.yaml index 9698b359..b5994165 100644 --- a/.github/workflows/library-nginx1.15.yaml +++ b/.github/workflows/library-nginx1.15.yaml @@ -47,6 +47,34 @@ 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_LOG_LEVEL=debug + 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