From bd13e38339522f8b5fe797392df86a0c14800fb4 Mon Sep 17 00:00:00 2001 From: Radu-Mihai ANGHELESCU Date: Fri, 12 Dec 2025 12:48:57 +0200 Subject: [PATCH] feat(workflows): Add workflows for http-elixir1.17 Signed-off-by: Radu-Mihai ANGHELESCU --- .../example-http-elixir1.17-stable.yaml | 77 +++++++++++++++++++ .../example-http-elixir1.17-staging.yaml | 77 +++++++++++++++++++ 2 files changed, 154 insertions(+) create mode 100644 .github/workflows/example-http-elixir1.17-stable.yaml create mode 100644 .github/workflows/example-http-elixir1.17-staging.yaml diff --git a/.github/workflows/example-http-elixir1.17-stable.yaml b/.github/workflows/example-http-elixir1.17-stable.yaml new file mode 100644 index 00000000..aac49e79 --- /dev/null +++ b/.github/workflows/example-http-elixir1.17-stable.yaml @@ -0,0 +1,77 @@ +name: examples/http-elixir1.17 (stable) + +on: + workflow_dispatch: + + push: + branches: [main] + paths: + - '.github/workflows/example-http-elixir1.17-stable.yaml' + - 'http-elixir1.17/**' + - '!http-elixir1.17/README.md' + + pull_request: + types: [opened, synchronize, reopened] + branches: [main] + paths: + - '.github/workflows/example-http-elixir1.17-stable.yaml' + - 'http-elixir1.17/**' + - '!http-elixir1.17/README.md' + + schedule: + - cron: '0 15 * * 1-5' + +# Automatically cancel in-progress actions on the same branch +concurrency: + group: ${{ github.workflow }}-${{ github.event_name == 'pull_request_target' && github.head_ref || github.ref }} + cancel-in-progress: true + +env: + UKC_METRO: "https://api.${{ vars.UKC_METRO_STABLE }}.unikraft.cloud/v1" + UKC_TOKEN: ${{ secrets.UKC_TOKEN }} + KRAFTKIT_NO_CHECK_UPDATES: true + KRAFTKIT_LOG_LEVEL: debug + +jobs: + integration: + timeout-minutes: 60 + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Test + id: test + uses: unikraft/kraftkit@staging + with: + run: | + set -xe; + + cd http-elixir1.17; + + kraft cloud deploy \ + --no-start \ + --name http-elixir117-${GITHUB_RUN_ID} \ + --runtime index.unikraft.io/official-testing/base-compat:latest \ + --subdomain http-elixir117-${GITHUB_RUN_ID} \ + -p 443:3000 \ + -M 1Gi \ + .; + + # wait for the instance to start + kraft cloud vm start -w 5s http-elixir117-${GITHUB_RUN_ID}; + sleep 5; + + curl -Lv --fail-with-body --max-time 10 https://http-elixir117-${GITHUB_RUN_ID}.${{ vars.UKC_METRO_STABLE }}.unikraft.app + + - name: Cleanup + uses: unikraft/kraftkit@staging + if: always() + with: + run: | + set -xe; + + kraft cloud vm stop http-elixir117-${GITHUB_RUN_ID} || true; + kraft cloud vm logs http-elixir117-${GITHUB_RUN_ID} || true; + kraft cloud vm rm http-elixir117-${GITHUB_RUN_ID} || true; + kraft cloud img rm index.unikraft.io/test/http-elixir117-${GITHUB_RUN_ID} || true; diff --git a/.github/workflows/example-http-elixir1.17-staging.yaml b/.github/workflows/example-http-elixir1.17-staging.yaml new file mode 100644 index 00000000..3f620457 --- /dev/null +++ b/.github/workflows/example-http-elixir1.17-staging.yaml @@ -0,0 +1,77 @@ +name: examples/http-elixir1.17 (staging) + +on: + workflow_dispatch: + + push: + branches: [main] + paths: + - '.github/workflows/example-http-elixir1.17-staging.yaml' + - 'http-elixir1.17/**' + - '!http-elixir1.17/README.md' + + pull_request: + types: [opened, synchronize, reopened] + branches: [main] + paths: + - '.github/workflows/example-http-elixir1.17-staging.yaml' + - 'http-elixir1.17/**' + - '!http-elixir1.17/README.md' + + schedule: + - cron: '0 15 * * 1-5' + +# Automatically cancel in-progress actions on the same branch +concurrency: + group: ${{ github.workflow }}-${{ github.event_name == 'pull_request_target' && github.head_ref || github.ref }} + cancel-in-progress: true + +env: + UKC_METRO: "https://api.${{ vars.UKC_METRO_STAGING }}.unikraft.cloud/v1" + UKC_TOKEN: ${{ secrets.UKC_TOKEN }} + KRAFTKIT_NO_CHECK_UPDATES: true + KRAFTKIT_LOG_LEVEL: debug + +jobs: + integration: + timeout-minutes: 60 + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Test + id: test + uses: unikraft/kraftkit@staging + with: + run: | + set -xe; + + cd http-elixir1.17; + + kraft cloud deploy \ + --no-start \ + --name http-elixir117-${GITHUB_RUN_ID} \ + --runtime index.unikraft.io/official-staging/base-compat:latest \ + --subdomain http-elixir117-${GITHUB_RUN_ID} \ + -p 443:3000 \ + -M 1Gi \ + .; + + # wait for the instance to start + kraft cloud vm start -w 5s http-elixir117-${GITHUB_RUN_ID}; + sleep 5; + + curl -Lv --fail-with-body --max-time 10 https://http-elixir117-${GITHUB_RUN_ID}.${{ vars.UKC_METRO_STAGING }}.unikraft.app + + - name: Cleanup + uses: unikraft/kraftkit@staging + if: always() + with: + run: | + set -xe; + + kraft cloud vm stop http-elixir117-${GITHUB_RUN_ID} || true; + kraft cloud vm logs http-elixir117-${GITHUB_RUN_ID} || true; + kraft cloud vm rm http-elixir117-${GITHUB_RUN_ID} || true; + kraft cloud img rm index.unikraft.io/test/http-elixir117-${GITHUB_RUN_ID} || true;