Skip to content

Commit

Permalink
add local action
Browse files Browse the repository at this point in the history
  • Loading branch information
vordimous committed Oct 21, 2024
1 parent c5d8107 commit e519b20
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 2 deletions.
62 changes: 62 additions & 0 deletions .github/actions/test-zilla-example/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Test Zilla Example
description: Starts and Runs the test.sh script for a specificy example folder in the zilla-examples repo
inputs:
example-dir: # id of input
description: 'Directory of the example to test'
required: true
default: ''
outputs:
result:
description: "testing results"
value: ${{ steps.test-executor.outputs.result }}
runs:
using: "composite"
steps:
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: zilla-image
path: /tmp

- name: Load image
shell: bash
run: |
docker load --input /tmp/zilla.tar
docker image ls -a
- name: Checkout docs repo
uses: actions/checkout@v4
with:
repository: aklivity/zilla-examples
ref: refs/heads/example-startup-compose

- name: Startup
shell: bash
env:
ZILLA_VERSION: develop-SNAPSHOT
ZILLA_PULL_POLICY: never
run: ./startup.sh ${{ inputs.example-dir }}

- name: Execute Test
shell: bash
id: test-executor
working-directory: openapi.proxy
run: |
set -o pipefail
./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
shell: bash
if: failure()
run: tar cvzf ./logs.tgz ./logs
- name: Upload logs to GitHub
if: failure()
uses: actions/upload-artifact@v4
with:
name: logs.tgz
path: ./logs.tgz
2 changes: 0 additions & 2 deletions .github/workflows/example-test-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,10 @@ jobs:
ref: refs/heads/example-startup-compose

- name: Startup
shell: bash
run: ./startup.sh openapi.proxy

- name: Execute Test
working-directory: openapi.proxy
shell: bash
run: |
set -o pipefail
./test.sh | tee $GITHUB_STEP_SUMMARY
Expand Down

0 comments on commit e519b20

Please sign in to comment.