From 470ce61458ccdb6172baf8f585742f60d5bb8b87 Mon Sep 17 00:00:00 2001 From: Ankit Kumar Date: Thu, 13 Mar 2025 09:53:49 +0530 Subject: [PATCH 01/28] update workflow --- .github/workflows/example_artifacts.yaml | 27 ------ .github/workflows/reusable_test_runner.yaml | 88 ----------------- .github/workflows/test.yaml | 102 +++++++++++++------- 3 files changed, 69 insertions(+), 148 deletions(-) delete mode 100644 .github/workflows/example_artifacts.yaml delete mode 100644 .github/workflows/reusable_test_runner.yaml diff --git a/.github/workflows/example_artifacts.yaml b/.github/workflows/example_artifacts.yaml deleted file mode 100644 index 916d5de6..00000000 --- a/.github/workflows/example_artifacts.yaml +++ /dev/null @@ -1,27 +0,0 @@ -name: Release Example Artifacts - -on: - push: - tags: - - "v[0-9]+" - -permissions: - contents: write - -jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - - name: Tar all examples - run: for i in */; do tar -zcvf "${i%/}.tar.gz" "$i"; done - - - name: Release - uses: softprops/action-gh-release@v2 - if: startsWith(github.ref, 'refs/tags/') - with: - files: | - startup.sh - *.tar.gz - LICENSE diff --git a/.github/workflows/reusable_test_runner.yaml b/.github/workflows/reusable_test_runner.yaml deleted file mode 100644 index 1ae2288e..00000000 --- a/.github/workflows/reusable_test_runner.yaml +++ /dev/null @@ -1,88 +0,0 @@ -name: Reusable Workflow for running tests - -on: - workflow_dispatch: - inputs: - example-dir: - required: true - description: Directory name for the example to test - type: string - zilla-image-tag: - default: latest - description: Zilla Image tag - type: string - zilla-image-artifact-name: - default: zilla-image-artifact - description: Artifact name for a Zilla Image - type: string - - workflow_call: - inputs: - example-dir: - required: true - type: string - zilla-image-tag: - type: string - zilla-image-artifact-name: - type: string - -jobs: - runner: - runs-on: ubuntu-latest - env: - ZILLA_VERSION: ${{ inputs.zilla-image-tag }} - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - sparse-checkout: ${{ inputs.example-dir }} - - - name: Cache Docker images. - if: ${{ hashFiles(format('{0}/compose.yaml', inputs.example-dir)) != '' }} - uses: ScribeMD/docker-cache@0.5.0 - with: - key: docker-${{ runner.os }}-${{ inputs.example-dir }}-${{ hashFiles(format('{0}/compose.yaml', inputs.example-dir)) }} - - - name: Download artifact - if: ${{ inputs.zilla-image-artifact-name != '' }} - uses: actions/download-artifact@v4 - with: - name: ${{ inputs.zilla-image-artifact-name }} - path: /tmp - - - name: Load image - if: ${{ inputs.zilla-image-artifact-name != '' }} - run: | - docker load --input /tmp/${{ inputs.zilla-image-artifact-name }}.tar - docker image ls -a - - - name: Start Zilla and wait for it to be healthy - working-directory: ${{ inputs.example-dir }} - run: docker compose up -d --wait - - - name: Execute Test - if: ${{ hashFiles(format('{0}/.github/test.sh', inputs.example-dir)) != '' }} - working-directory: ${{ inputs.example-dir }} - run: | - set -o pipefail - ./.github/test.sh | tee $GITHUB_STEP_SUMMARY - - - name: Collect docker logs on failure - if: failure() - uses: jwalton/gh-docker-logs@v2 - with: - dest: "./logs" - - name: Tar logs - if: failure() - run: tar cvzf ./logs.tgz ./logs - - name: Upload logs to GitHub - if: failure() - uses: actions/upload-artifact@v4 - with: - name: ${{ inputs.example-dir }}_logs.tgz - path: ./logs.tgz - - - name: Teardown - if: always() && ${{ hashFiles(format('{0}/teardown.sh', inputs.example-dir)) != '' }} - working-directory: ${{ inputs.example-dir }} - run: docker compose down --remove-orphans diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index d61ab271..61aaba9e 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -3,44 +3,80 @@ name: Test Examples on: pull_request: workflow_dispatch: + inputs: + zilla-image-tag: + default: latest + description: Zilla Image tag + type: string + + workflow_call: + inputs: + zilla-image-tag: + type: string jobs: - get-examples-with-changes: + testing: runs-on: ubuntu-latest - outputs: - changed_directories: ${{ steps.set-output.outputs.changed_directories }} + strategy: + matrix: + dir: ${{ fromJson(steps.get-dirs.outputs.all_dirs) }} + fail-fast: false + env: + ZILLA_VERSION: ${{ inputs.zilla-image-tag }} steps: - - uses: actions/checkout@v4 + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Get all directories (excluding ignored ones) + id: get-dirs + run: | + dirs=$(find . -maxdepth 1 -type d \ + -not -name ".github" \ + -not -name ".assets" \ + -not -name "." \ + -exec test -n "$(find {} -type f ! -name '*.md' ! -path './.github/*' ! -path './.assets/*' -print -quit)" \; \ + -exec basename {} \; | jq -R -s -c 'split("\n") | map(select(length > 0))') + echo "all_dirs=$dirs" >> "$GITHUB_OUTPUT" + + - name: Checkout specific directory + uses: actions/checkout@v4 with: - fetch-depth: 0 + sparse-checkout: ${{ matrix.dir }} - - name: Get changed files - id: changed-files - uses: tj-actions/changed-files@v45.0.3 + - name: Cache Docker images + uses: ScribeMD/docker-cache@0.5.0 with: - # only get the top level example dirs that have changes - dir_names: true - dir_names_max_depth: 1 - dir_names_exclude_current_dir: true - exclude_submodules: true - files_ignore: | - *.md - .github/**/* - .assets/**/* - json: true - quotepath: false - - - name: "Set output in the matrix format" - id: set-output - run: echo "changed_directories={\"dir\":${{ steps.changed-files.outputs.all_changed_files }}}" >> "$GITHUB_OUTPUT" + key: docker-${{ runner.os }}-${{ matrix.dir }}-${{ hashFiles(format('{0}/compose.yaml', matrix.dir)) }} - testing: - if: ${{ needs.get-examples-with-changes.outputs.changed_directories != '' }} - strategy: - matrix: ${{fromJson(needs.get-examples-with-changes.outputs.changed_directories)}} - fail-fast: false - needs: - - get-examples-with-changes - uses: ./.github/workflows/reusable_test_runner.yaml - with: - example-dir: ${{ matrix.dir }} + - name: Start Zilla and wait for it to be healthy + working-directory: ${{ matrix.dir }} + run: docker compose up -d --wait + + - name: Execute Test + if: ${{ hashFiles(format('{0}/.github/test.sh', matrix.dir)) != '' }} + working-directory: ${{ matrix.dir }} + run: | + set -o pipefail + ./.github/test.sh | tee $GITHUB_STEP_SUMMARY + + - name: Collect docker logs on failure + if: failure() + uses: jwalton/gh-docker-logs@v2 + with: + dest: "./logs" + + - name: Tar logs + if: failure() + run: tar cvzf ./logs.tgz ./logs + + - name: Upload logs to GitHub + if: failure() + uses: actions/upload-artifact@v4 + with: + name: ${{ matrix.dir }}_logs.tgz + path: ./logs.tgz + + - name: Teardown + if: always() && ${{ hashFiles(format('{0}/teardown.sh', matrix.dir)) != '' }} + working-directory: ${{ matrix.dir }} + run: docker compose down --remove-orphans From 664d73841b0c6007273d55ff3348245561152fae Mon Sep 17 00:00:00 2001 From: Ankit Kumar Date: Thu, 13 Mar 2025 10:18:35 +0530 Subject: [PATCH 02/28] update --- .github/workflows/reusable_test_runner.yaml | 69 ++++++++++++++++ .github/workflows/test.yaml | 88 +++++---------------- 2 files changed, 89 insertions(+), 68 deletions(-) create mode 100644 .github/workflows/reusable_test_runner.yaml diff --git a/.github/workflows/reusable_test_runner.yaml b/.github/workflows/reusable_test_runner.yaml new file mode 100644 index 00000000..d838b1a2 --- /dev/null +++ b/.github/workflows/reusable_test_runner.yaml @@ -0,0 +1,69 @@ +name: Reusable Workflow for running tests + +on: + workflow_dispatch: + inputs: + example-dir: + required: true + description: Directory name for the example to test + type: string + zilla-image-tag: + default: latest + description: Zilla Image tag + type: string + + workflow_call: + inputs: + example-dir: + required: true + type: string + zilla-image-tag: + type: string + +jobs: + runner: + runs-on: ubuntu-latest + env: + ZILLA_VERSION: ${{ inputs.zilla-image-tag }} + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + sparse-checkout: ${{ inputs.example-dir }} + + - name: Cache Docker images. + if: ${{ hashFiles(format('{0}/compose.yaml', inputs.example-dir)) != '' }} + uses: ScribeMD/docker-cache@0.5.0 + with: + key: docker-${{ runner.os }}-${{ inputs.example-dir }}-${{ hashFiles(format('{0}/compose.yaml', inputs.example-dir)) }} + + - name: Start Zilla and wait for it to be healthy + working-directory: ${{ inputs.example-dir }} + run: docker compose up -d --wait + + - name: Execute Test + if: ${{ hashFiles(format('{0}/.github/test.sh', inputs.example-dir)) != '' }} + working-directory: ${{ inputs.example-dir }} + run: | + set -o pipefail + ./.github/test.sh | tee $GITHUB_STEP_SUMMARY + + - name: Collect docker logs on failure + if: failure() + uses: jwalton/gh-docker-logs@v2 + with: + dest: "./logs" + - name: Tar logs + if: failure() + run: tar cvzf ./logs.tgz ./logs + - name: Upload logs to GitHub + if: failure() + uses: actions/upload-artifact@v4 + with: + name: ${{ inputs.example-dir }}_logs.tgz + path: ./logs.tgz + + - name: Teardown + if: always() && ${{ hashFiles(format('{0}/teardown.sh', inputs.example-dir)) != '' }} + working-directory: ${{ inputs.example-dir }} + run: docker compose down --remove-orphans diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 61aaba9e..1764abd1 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -3,80 +3,32 @@ name: Test Examples on: pull_request: workflow_dispatch: - inputs: - zilla-image-tag: - default: latest - description: Zilla Image tag - type: string - - workflow_call: - inputs: - zilla-image-tag: - type: string jobs: - testing: + get-examples-dirs: runs-on: ubuntu-latest - strategy: - matrix: - dir: ${{ fromJson(steps.get-dirs.outputs.all_dirs) }} - fail-fast: false - env: - ZILLA_VERSION: ${{ inputs.zilla-image-tag }} + outputs: + all_directories: ${{ steps.list-dirs.outputs.folders_no_base_path }} steps: - name: Checkout repository uses: actions/checkout@v4 - - name: Get all directories (excluding ignored ones) - id: get-dirs - run: | - dirs=$(find . -maxdepth 1 -type d \ - -not -name ".github" \ - -not -name ".assets" \ - -not -name "." \ - -exec test -n "$(find {} -type f ! -name '*.md' ! -path './.github/*' ! -path './.assets/*' -print -quit)" \; \ - -exec basename {} \; | jq -R -s -c 'split("\n") | map(select(length > 0))') - echo "all_dirs=$dirs" >> "$GITHUB_OUTPUT" - - - name: Checkout specific directory - uses: actions/checkout@v4 - with: - sparse-checkout: ${{ matrix.dir }} - - - name: Cache Docker images - uses: ScribeMD/docker-cache@0.5.0 - with: - key: docker-${{ runner.os }}-${{ matrix.dir }}-${{ hashFiles(format('{0}/compose.yaml', matrix.dir)) }} - - - name: Start Zilla and wait for it to be healthy - working-directory: ${{ matrix.dir }} - run: docker compose up -d --wait - - - name: Execute Test - if: ${{ hashFiles(format('{0}/.github/test.sh', matrix.dir)) != '' }} - working-directory: ${{ matrix.dir }} - run: | - set -o pipefail - ./.github/test.sh | tee $GITHUB_STEP_SUMMARY - - - name: Collect docker logs on failure - if: failure() - uses: jwalton/gh-docker-logs@v2 + - name: List all example directories + id: list-dirs + uses: Drafteame/list-folders-action@main with: - dest: "./logs" + paths: . + omit: | + ^\.github$ + ^\.assets$ + separator: "," - - name: Tar logs - if: failure() - run: tar cvzf ./logs.tgz ./logs - - - name: Upload logs to GitHub - if: failure() - uses: actions/upload-artifact@v4 - with: - name: ${{ matrix.dir }}_logs.tgz - path: ./logs.tgz - - - name: Teardown - if: always() && ${{ hashFiles(format('{0}/teardown.sh', matrix.dir)) != '' }} - working-directory: ${{ matrix.dir }} - run: docker compose down --remove-orphans + testing: + strategy: + matrix: ${{fromJson(needs.get-examples-dirs.outputs.all_directories)}} + fail-fast: false + needs: + - get-examples-dir + uses: ./.github/workflows/reusable_test_runner.yaml + with: + example-dir: ${{ matrix.dir }} From 9b26451d4dadb0b0a35b263913f402c10853eddf Mon Sep 17 00:00:00 2001 From: Ankit Kumar Date: Thu, 13 Mar 2025 10:20:22 +0530 Subject: [PATCH 03/28] update --- grpc.echo/README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/grpc.echo/README.md b/grpc.echo/README.md index f30cee70..45d89bcb 100644 --- a/grpc.echo/README.md +++ b/grpc.echo/README.md @@ -68,3 +68,5 @@ To remove any resources created by the Docker Compose stack, use: ```bash docker compose down ``` + +# Dummy change From b248dd95f9c59aad6e3f825ae0ce723b69153e7d Mon Sep 17 00:00:00 2001 From: Ankit Kumar Date: Thu, 13 Mar 2025 10:21:20 +0530 Subject: [PATCH 04/28] update --- .github/workflows/test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 1764abd1..ab079af9 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -28,7 +28,7 @@ jobs: matrix: ${{fromJson(needs.get-examples-dirs.outputs.all_directories)}} fail-fast: false needs: - - get-examples-dir + - get-examples-dirs uses: ./.github/workflows/reusable_test_runner.yaml with: example-dir: ${{ matrix.dir }} From ed9abb51163a49fab1b95c006576c0781e84b529 Mon Sep 17 00:00:00 2001 From: Ankit Kumar Date: Thu, 13 Mar 2025 10:24:34 +0530 Subject: [PATCH 05/28] Update test.yaml --- .github/workflows/test.yaml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index ab079af9..943cc65b 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -24,11 +24,12 @@ jobs: separator: "," testing: + runs-on: ubuntu-latest + needs: get-examples-dirs strategy: - matrix: ${{fromJson(needs.get-examples-dirs.outputs.all_directories)}} + matrix: + dir: ${{ fromJson(needs.get-examples-dirs.outputs.all_directories) }} fail-fast: false - needs: - - get-examples-dirs uses: ./.github/workflows/reusable_test_runner.yaml with: example-dir: ${{ matrix.dir }} From f25ce933c17f79edeafd101a955da67a3db63619 Mon Sep 17 00:00:00 2001 From: Ankit Kumar Date: Thu, 13 Mar 2025 10:30:38 +0530 Subject: [PATCH 06/28] Update test.yaml --- .github/workflows/test.yaml | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 943cc65b..c1bfff0a 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -8,7 +8,7 @@ jobs: get-examples-dirs: runs-on: ubuntu-latest outputs: - all_directories: ${{ steps.list-dirs.outputs.folders_no_base_path }} + all_directories: ${{ steps.set-output.outputs.changed_directories }} steps: - name: Checkout repository uses: actions/checkout@v4 @@ -23,6 +23,10 @@ jobs: ^\.assets$ separator: "," + - name: "Set output in the matrix format" + id: set-output + run: echo "changed_directories=${{ steps.list-dirs.outputs.folders_no_base_path }}" >> "$GITHUB_OUTPUT" + testing: runs-on: ubuntu-latest needs: get-examples-dirs @@ -30,6 +34,8 @@ jobs: matrix: dir: ${{ fromJson(needs.get-examples-dirs.outputs.all_directories) }} fail-fast: false - uses: ./.github/workflows/reusable_test_runner.yaml - with: - example-dir: ${{ matrix.dir }} + steps: + - name: Run reusable test runner + uses: ./.github/workflows/reusable_test_runner.yaml + with: + example-dir: ${{ matrix.dir }} From 60be7aea558cc23ca4388ac8b827778829b30009 Mon Sep 17 00:00:00 2001 From: Ankit Kumar Date: Thu, 13 Mar 2025 10:37:30 +0530 Subject: [PATCH 07/28] Update test.yaml --- .github/workflows/test.yaml | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index c1bfff0a..e76db853 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -5,37 +5,38 @@ on: workflow_dispatch: jobs: - get-examples-dirs: + list-examples-dirs: + name: List Example Directories runs-on: ubuntu-latest outputs: - all_directories: ${{ steps.set-output.outputs.changed_directories }} + folders: ${{ steps.list-dirs.outputs.folders }} steps: - name: Checkout repository uses: actions/checkout@v4 - name: List all example directories id: list-dirs - uses: Drafteame/list-folders-action@main + uses: philips-labs/list-folders-action@v1 with: - paths: . - omit: | - ^\.github$ - ^\.assets$ - separator: "," - - - name: "Set output in the matrix format" - id: set-output - run: echo "changed_directories=${{ steps.list-dirs.outputs.folders_no_base_path }}" >> "$GITHUB_OUTPUT" + path: . + exclude: | + .github + .assets testing: runs-on: ubuntu-latest - needs: get-examples-dirs + needs: list-examples-dirs strategy: matrix: - dir: ${{ fromJson(needs.get-examples-dirs.outputs.all_directories) }} + folder: ${{ fromJson(needs.list-examples-dirs.outputs.folders) }} fail-fast: false steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + sparse-checkout: ${{ matrix.folder }} + - name: Run reusable test runner uses: ./.github/workflows/reusable_test_runner.yaml with: - example-dir: ${{ matrix.dir }} + example-dir: ${{ matrix.folder }} From 1248141c154d5d0cd75a1cc7c16782896f2cdd2e Mon Sep 17 00:00:00 2001 From: Ankit Kumar Date: Thu, 13 Mar 2025 10:42:40 +0530 Subject: [PATCH 08/28] Update test.yaml --- .github/workflows/test.yaml | 29 +++++++++++------------------ 1 file changed, 11 insertions(+), 18 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index e76db853..eb8f929a 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -6,13 +6,13 @@ on: jobs: list-examples-dirs: - name: List Example Directories runs-on: ubuntu-latest outputs: - folders: ${{ steps.list-dirs.outputs.folders }} + all_directories: ${{ steps.list-dirs.outputs.folders }} steps: - - name: Checkout repository - uses: actions/checkout@v4 + - uses: actions/checkout@v4 + with: + fetch-depth: 0 - name: List all example directories id: list-dirs @@ -24,19 +24,12 @@ jobs: .assets testing: - runs-on: ubuntu-latest - needs: list-examples-dirs + if: ${{ needs.list-examples-dirs.outputs.all_directories != '' }} strategy: - matrix: - folder: ${{ fromJson(needs.list-examples-dirs.outputs.folders) }} + matrix: ${{fromJson(needs.list-examples-dirs.outputs.all_directories)}} fail-fast: false - steps: - - name: Checkout repository - uses: actions/checkout@v4 - with: - sparse-checkout: ${{ matrix.folder }} - - - name: Run reusable test runner - uses: ./.github/workflows/reusable_test_runner.yaml - with: - example-dir: ${{ matrix.folder }} + needs: + - list-examples-dirs + uses: ./.github/workflows/reusable_test_runner.yaml + with: + example-dir: ${{ matrix.dir }} From 1c0ab8410f56ffbe7e7e6959f74ef8bb1c3ab0cb Mon Sep 17 00:00:00 2001 From: Ankit Kumar Date: Thu, 13 Mar 2025 10:59:46 +0530 Subject: [PATCH 09/28] Update test.yaml --- .github/workflows/test.yaml | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index eb8f929a..b79be2a5 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -5,31 +5,27 @@ on: workflow_dispatch: jobs: - list-examples-dirs: + get-examples-dirs: runs-on: ubuntu-latest outputs: - all_directories: ${{ steps.list-dirs.outputs.folders }} + all_directories: ${{ steps.all-files.outputs.folders }} steps: - uses: actions/checkout@v4 with: fetch-depth: 0 - - name: List all example directories - id: list-dirs + - name: Get examples dirs + id: all-files uses: philips-labs/list-folders-action@v1 with: path: . - exclude: | - .github - .assets testing: - if: ${{ needs.list-examples-dirs.outputs.all_directories != '' }} strategy: - matrix: ${{fromJson(needs.list-examples-dirs.outputs.all_directories)}} + matrix: ${{fromJson(needs.get-examples-dirs.outputs.all_directories)}} fail-fast: false needs: - - list-examples-dirs + - get-examples-dirs uses: ./.github/workflows/reusable_test_runner.yaml with: example-dir: ${{ matrix.dir }} From f44f6a654fcf6189702941e283a88b416c240333 Mon Sep 17 00:00:00 2001 From: Ankit Kumar Date: Thu, 13 Mar 2025 11:02:08 +0530 Subject: [PATCH 10/28] Update test.yaml --- .github/workflows/test.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index b79be2a5..92010804 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -8,7 +8,7 @@ jobs: get-examples-dirs: runs-on: ubuntu-latest outputs: - all_directories: ${{ steps.all-files.outputs.folders }} + all_directories: ${{ steps.all-files.outputs.folders_no_base_path }} steps: - uses: actions/checkout@v4 with: @@ -16,7 +16,7 @@ jobs: - name: Get examples dirs id: all-files - uses: philips-labs/list-folders-action@v1 + uses: Drafteame/list-folders-action@main with: path: . From f203ff338fec0206a65171d61d9625abbf0191e7 Mon Sep 17 00:00:00 2001 From: Ankit Kumar Date: Thu, 13 Mar 2025 14:06:51 +0530 Subject: [PATCH 11/28] Update test.yaml --- .github/workflows/test.yaml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 92010804..4f460c6f 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -18,7 +18,11 @@ jobs: id: all-files uses: Drafteame/list-folders-action@main with: - path: . + paths: | + . + omit: | + .github/**/* + .assets/**/* testing: strategy: From 7aaaf4810487f2830f6fbea50a370af905b7780d Mon Sep 17 00:00:00 2001 From: Ankit Kumar Date: Thu, 13 Mar 2025 14:08:16 +0530 Subject: [PATCH 12/28] Update test.yaml --- .github/workflows/test.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 4f460c6f..9a8f38dd 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -21,8 +21,8 @@ jobs: paths: | . omit: | - .github/**/* - .assets/**/* + ^\.github$ + ^\.assets$ testing: strategy: From 5360c4651362bfb54aa9de5d764456a8917c7546 Mon Sep 17 00:00:00 2001 From: Ankit Kumar Date: Thu, 13 Mar 2025 14:12:23 +0530 Subject: [PATCH 13/28] Update test.yaml --- .github/workflows/test.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 9a8f38dd..fe0ffadf 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -23,6 +23,9 @@ jobs: omit: | ^\.github$ ^\.assets$ + + - name: Debug output + run: echo "all_directories=${{ steps.all-files.outputs.folders_no_base_path }}" testing: strategy: From 901eb7bb7bd59962bb7f3a74d7992244fe12b165 Mon Sep 17 00:00:00 2001 From: Ankit Kumar Date: Thu, 13 Mar 2025 14:22:16 +0530 Subject: [PATCH 14/28] Update test.yaml --- .github/workflows/test.yaml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index fe0ffadf..bd0bbd48 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -23,13 +23,15 @@ jobs: omit: | ^\.github$ ^\.assets$ - + ^\.git$ + ^\.vscode$ + - name: Debug output run: echo "all_directories=${{ steps.all-files.outputs.folders_no_base_path }}" testing: strategy: - matrix: ${{fromJson(needs.get-examples-dirs.outputs.all_directories)}} + matrix: ${{ needs.get-examples-dirs.outputs.all_directories }} fail-fast: false needs: - get-examples-dirs From edfbc3c3981e4d548d5ca37b99d5906a265356b7 Mon Sep 17 00:00:00 2001 From: Ankit Kumar Date: Thu, 13 Mar 2025 14:25:05 +0530 Subject: [PATCH 15/28] Update test.yaml --- .github/workflows/test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index bd0bbd48..9f847cb9 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -31,7 +31,7 @@ jobs: testing: strategy: - matrix: ${{ needs.get-examples-dirs.outputs.all_directories }} + matrix: [amqp.reflect,asyncapi.http.kafka.proxy,asyncapi.mqtt.kafka.proxy,asyncapi.mqtt.proxy,asyncapi.sse.kafka.proxy,asyncapi.sse.proxy,grpc.echo,grpc.kafka.echo,grpc.kafka.fanout,grpc.kafka.proxy,grpc.proxy,http.filesystem,http.json.schema,http.kafka.async,http.kafka.avro.json,http.kafka.cache,http.kafka.crud,http.kafka.oneway,http.kafka.proto.json,http.kafka.proto.oneway,http.kafka.sync,http.proxy,http.proxy.jwt,mqtt.kafka.proxy,mqtt.proxy.jwt,openapi.asyncapi.kakfa.proxy,openapi.proxy,sse.jwt,sse.kafka.fanout,tcp.echo,tcp.reflect,tls.echo,tls.reflect,ws.echo,ws.reflect] fail-fast: false needs: - get-examples-dirs From fc466a2b1cdbd6fbbb20047b36f833688e241d4e Mon Sep 17 00:00:00 2001 From: Ankit Kumar Date: Thu, 13 Mar 2025 14:25:58 +0530 Subject: [PATCH 16/28] Update test.yaml --- .github/workflows/test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 9f847cb9..4c57f9d9 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -31,7 +31,7 @@ jobs: testing: strategy: - matrix: [amqp.reflect,asyncapi.http.kafka.proxy,asyncapi.mqtt.kafka.proxy,asyncapi.mqtt.proxy,asyncapi.sse.kafka.proxy,asyncapi.sse.proxy,grpc.echo,grpc.kafka.echo,grpc.kafka.fanout,grpc.kafka.proxy,grpc.proxy,http.filesystem,http.json.schema,http.kafka.async,http.kafka.avro.json,http.kafka.cache,http.kafka.crud,http.kafka.oneway,http.kafka.proto.json,http.kafka.proto.oneway,http.kafka.sync,http.proxy,http.proxy.jwt,mqtt.kafka.proxy,mqtt.proxy.jwt,openapi.asyncapi.kakfa.proxy,openapi.proxy,sse.jwt,sse.kafka.fanout,tcp.echo,tcp.reflect,tls.echo,tls.reflect,ws.echo,ws.reflect] + matrix: [ amqp.reflect, asyncapi.http.kafka.proxy ] fail-fast: false needs: - get-examples-dirs From 195913069477ea1009cb7c59ba5b829ddb18bae2 Mon Sep 17 00:00:00 2001 From: Ankit Kumar Date: Thu, 13 Mar 2025 14:27:40 +0530 Subject: [PATCH 17/28] Update test.yaml --- .github/workflows/test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 4c57f9d9..015cd7f6 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -31,7 +31,7 @@ jobs: testing: strategy: - matrix: [ amqp.reflect, asyncapi.http.kafka.proxy ] + matrix: [ "amqp.reflect", "asyncapi.http.kafka.proxy" ] fail-fast: false needs: - get-examples-dirs From 9369c10236e000806bb21053ba5a2c6521d8dc51 Mon Sep 17 00:00:00 2001 From: Ankit Kumar Date: Thu, 13 Mar 2025 14:28:11 +0530 Subject: [PATCH 18/28] Update test.yaml --- .github/workflows/test.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 015cd7f6..3b85faa3 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -31,7 +31,8 @@ jobs: testing: strategy: - matrix: [ "amqp.reflect", "asyncapi.http.kafka.proxy" ] + matrix: + dir: [ "amqp.reflect", "asyncapi.http.kafka.proxy" ] fail-fast: false needs: - get-examples-dirs From b3f00d0a62f56c9ad5eb643288db57c33a4b10b8 Mon Sep 17 00:00:00 2001 From: Ankit Kumar Date: Thu, 13 Mar 2025 14:29:46 +0530 Subject: [PATCH 19/28] Update test.yaml --- .github/workflows/test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 3b85faa3..d56c38fe 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -32,7 +32,7 @@ jobs: testing: strategy: matrix: - dir: [ "amqp.reflect", "asyncapi.http.kafka.proxy" ] + dir: [ amqp.reflect, asyncapi.http.kafka.proxy ] fail-fast: false needs: - get-examples-dirs From f341c6eed37de40e67d22b4d8e39e4f9250db79e Mon Sep 17 00:00:00 2001 From: Ankit Kumar Date: Thu, 13 Mar 2025 14:31:40 +0530 Subject: [PATCH 20/28] Update test.yaml --- .github/workflows/test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index d56c38fe..f59e6e9b 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -32,7 +32,7 @@ jobs: testing: strategy: matrix: - dir: [ amqp.reflect, asyncapi.http.kafka.proxy ] + dir: ${{ needs.get-examples-dirs.outputs.all_directories }} fail-fast: false needs: - get-examples-dirs From 8b86fef42668c3b9696354f23cd6bf30a64a201e Mon Sep 17 00:00:00 2001 From: Ankit Kumar Date: Thu, 13 Mar 2025 14:33:26 +0530 Subject: [PATCH 21/28] Update test.yaml --- .github/workflows/test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index f59e6e9b..932271d4 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -32,7 +32,7 @@ jobs: testing: strategy: matrix: - dir: ${{ needs.get-examples-dirs.outputs.all_directories }} + dir: [amqp.reflect,asyncapi.http.kafka.proxy] fail-fast: false needs: - get-examples-dirs From 83b5f358e20604160c886441b75d8eb844d05a8f Mon Sep 17 00:00:00 2001 From: Ankit Kumar Date: Thu, 13 Mar 2025 14:35:26 +0530 Subject: [PATCH 22/28] Update test.yaml --- .github/workflows/test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 932271d4..4a486579 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -32,7 +32,7 @@ jobs: testing: strategy: matrix: - dir: [amqp.reflect,asyncapi.http.kafka.proxy] + dir: ["amqp.reflect","asyncapi.http.kafka.proxy"] fail-fast: false needs: - get-examples-dirs From a0ae0ced6589bccf0c3be772d931340e79fa51a7 Mon Sep 17 00:00:00 2001 From: Ankit Kumar Date: Thu, 13 Mar 2025 14:36:56 +0530 Subject: [PATCH 23/28] Update test.yaml --- .github/workflows/test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 4a486579..1d22f41c 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -32,7 +32,7 @@ jobs: testing: strategy: matrix: - dir: ["amqp.reflect","asyncapi.http.kafka.proxy"] + dir: [amqp.reflect,asyncapi.http.kafka.proxy,asyncapi.mqtt.kafka.proxy,asyncapi.mqtt.proxy,asyncapi.sse.kafka.proxy,asyncapi.sse.proxy,grpc.echo,grpc.kafka.echo,grpc.kafka.fanout,grpc.kafka.proxy,grpc.proxy,http.filesystem,http.json.schema,http.kafka.async,http.kafka.avro.json,http.kafka.cache,http.kafka.crud,http.kafka.oneway,http.kafka.proto.json,http.kafka.proto.oneway,http.kafka.sync,http.proxy,http.proxy.jwt,mqtt.kafka.proxy,mqtt.proxy.jwt,openapi.asyncapi.kakfa.proxy,openapi.proxy,sse.jwt,sse.kafka.fanout,tcp.echo,tcp.reflect,tls.echo,tls.reflect,ws.echo,ws.reflect] fail-fast: false needs: - get-examples-dirs From 348c34aa87c01a8e9f29565face9f3a428f1f6ab Mon Sep 17 00:00:00 2001 From: Ankit Kumar Date: Thu, 13 Mar 2025 14:41:13 +0530 Subject: [PATCH 24/28] Update test.yaml --- .github/workflows/test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 1d22f41c..1fb289a7 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -32,7 +32,7 @@ jobs: testing: strategy: matrix: - dir: [amqp.reflect,asyncapi.http.kafka.proxy,asyncapi.mqtt.kafka.proxy,asyncapi.mqtt.proxy,asyncapi.sse.kafka.proxy,asyncapi.sse.proxy,grpc.echo,grpc.kafka.echo,grpc.kafka.fanout,grpc.kafka.proxy,grpc.proxy,http.filesystem,http.json.schema,http.kafka.async,http.kafka.avro.json,http.kafka.cache,http.kafka.crud,http.kafka.oneway,http.kafka.proto.json,http.kafka.proto.oneway,http.kafka.sync,http.proxy,http.proxy.jwt,mqtt.kafka.proxy,mqtt.proxy.jwt,openapi.asyncapi.kakfa.proxy,openapi.proxy,sse.jwt,sse.kafka.fanout,tcp.echo,tcp.reflect,tls.echo,tls.reflect,ws.echo,ws.reflect] + dir: ${{ fromJson(needs.get-examples-dirs.outputs.all_directories) }} fail-fast: false needs: - get-examples-dirs From 44f366d2013b4f4b34931a1e80537879b6732ba1 Mon Sep 17 00:00:00 2001 From: Ankit Kumar Date: Thu, 13 Mar 2025 14:47:16 +0530 Subject: [PATCH 25/28] Update test.yaml --- .github/workflows/test.yaml | 48 ++++++++++++++++++++++++++++++++++--- 1 file changed, 45 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 1fb289a7..3194d7a8 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -36,6 +36,48 @@ jobs: fail-fast: false needs: - get-examples-dirs - uses: ./.github/workflows/reusable_test_runner.yaml - with: - example-dir: ${{ matrix.dir }} + runs-on: ubuntu-latest + env: + ZILLA_VERSION: latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + sparse-checkout: ${{ matrix.dir }} + + - name: Cache Docker images + if: ${{ hashFiles(format('{0}/compose.yaml', matrix.dir)) != '' }} + uses: ScribeMD/docker-cache@0.5.0 + with: + key: docker-${{ runner.os }}-${{ matrix.dir }}-${{ hashFiles(format('{0}/compose.yaml', matrix.dir)) }} + + - name: Start Zilla and wait for it to be healthy + working-directory: ${{ matrix.dir }} + run: docker compose up -d --wait + + - name: Execute Test + if: ${{ hashFiles(format('{0}/.github/test.sh', matrix.dir)) != '' }} + working-directory: ${{ matrix.dir }} + run: | + set -o pipefail + ./.github/test.sh | tee $GITHUB_STEP_SUMMARY + + - name: Collect docker logs on failure + if: failure() + uses: jwalton/gh-docker-logs@v2 + with: + dest: "./logs" + - name: Tar logs + if: failure() + run: tar cvzf ./logs.tgz ./logs + - name: Upload logs to GitHub + if: failure() + uses: actions/upload-artifact@v4 + with: + name: ${{ matrix.dir }}_logs.tgz + path: ./logs.tgz + + - name: Teardown + if: always() && ${{ hashFiles(format('{0}/teardown.sh', matrix.dir)) != '' }} + working-directory: ${{ matrix.dir }} + run: docker compose down --remove-orphans From 662eabf91416e6f3a66f51b5d5878daabe560038 Mon Sep 17 00:00:00 2001 From: Ankit Kumar Date: Thu, 13 Mar 2025 14:51:19 +0530 Subject: [PATCH 26/28] Update test.yaml --- .github/workflows/test.yaml | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 3194d7a8..63242d2f 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -3,6 +3,16 @@ name: Test Examples on: pull_request: workflow_dispatch: + inputs: + zilla-image-tag: + default: latest + description: Zilla Image tag + type: string + + workflow_call: + inputs: + zilla-image-tag: + type: string jobs: get-examples-dirs: @@ -26,9 +36,6 @@ jobs: ^\.git$ ^\.vscode$ - - name: Debug output - run: echo "all_directories=${{ steps.all-files.outputs.folders_no_base_path }}" - testing: strategy: matrix: @@ -38,7 +45,7 @@ jobs: - get-examples-dirs runs-on: ubuntu-latest env: - ZILLA_VERSION: latest + ZILLA_VERSION: ${{ inputs.zilla-image-tag }} steps: - name: Checkout uses: actions/checkout@v4 From a2754b79d67768ad6d9e4f96ee113e25e5503c49 Mon Sep 17 00:00:00 2001 From: Ankit Kumar Date: Thu, 13 Mar 2025 14:54:09 +0530 Subject: [PATCH 27/28] Delete reusable_test_runner.yaml --- .github/workflows/reusable_test_runner.yaml | 69 --------------------- 1 file changed, 69 deletions(-) delete mode 100644 .github/workflows/reusable_test_runner.yaml diff --git a/.github/workflows/reusable_test_runner.yaml b/.github/workflows/reusable_test_runner.yaml deleted file mode 100644 index d838b1a2..00000000 --- a/.github/workflows/reusable_test_runner.yaml +++ /dev/null @@ -1,69 +0,0 @@ -name: Reusable Workflow for running tests - -on: - workflow_dispatch: - inputs: - example-dir: - required: true - description: Directory name for the example to test - type: string - zilla-image-tag: - default: latest - description: Zilla Image tag - type: string - - workflow_call: - inputs: - example-dir: - required: true - type: string - zilla-image-tag: - type: string - -jobs: - runner: - runs-on: ubuntu-latest - env: - ZILLA_VERSION: ${{ inputs.zilla-image-tag }} - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - sparse-checkout: ${{ inputs.example-dir }} - - - name: Cache Docker images. - if: ${{ hashFiles(format('{0}/compose.yaml', inputs.example-dir)) != '' }} - uses: ScribeMD/docker-cache@0.5.0 - with: - key: docker-${{ runner.os }}-${{ inputs.example-dir }}-${{ hashFiles(format('{0}/compose.yaml', inputs.example-dir)) }} - - - name: Start Zilla and wait for it to be healthy - working-directory: ${{ inputs.example-dir }} - run: docker compose up -d --wait - - - name: Execute Test - if: ${{ hashFiles(format('{0}/.github/test.sh', inputs.example-dir)) != '' }} - working-directory: ${{ inputs.example-dir }} - run: | - set -o pipefail - ./.github/test.sh | tee $GITHUB_STEP_SUMMARY - - - name: Collect docker logs on failure - if: failure() - uses: jwalton/gh-docker-logs@v2 - with: - dest: "./logs" - - name: Tar logs - if: failure() - run: tar cvzf ./logs.tgz ./logs - - name: Upload logs to GitHub - if: failure() - uses: actions/upload-artifact@v4 - with: - name: ${{ inputs.example-dir }}_logs.tgz - path: ./logs.tgz - - - name: Teardown - if: always() && ${{ hashFiles(format('{0}/teardown.sh', inputs.example-dir)) != '' }} - working-directory: ${{ inputs.example-dir }} - run: docker compose down --remove-orphans From 4c5d155b06bdbf42e6acaf3cfa5638927d1c8a95 Mon Sep 17 00:00:00 2001 From: Ankit Kumar Date: Thu, 13 Mar 2025 14:56:27 +0530 Subject: [PATCH 28/28] remove dummy change --- grpc.echo/README.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/grpc.echo/README.md b/grpc.echo/README.md index 45d89bcb..f30cee70 100644 --- a/grpc.echo/README.md +++ b/grpc.echo/README.md @@ -68,5 +68,3 @@ To remove any resources created by the Docker Compose stack, use: ```bash docker compose down ``` - -# Dummy change