Skip to content

Commit

Permalink
test: add test case
Browse files Browse the repository at this point in the history
Signed-off-by: Junjie Gao <[email protected]>
  • Loading branch information
JeyJeyGao committed Nov 21, 2023
1 parent 1dc4899 commit 450fedb
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 20 deletions.
39 changes: 21 additions & 18 deletions .github/e2e/action.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,26 @@
name: 'Hello World'
description: 'Greet someone'
name: 'notation-azure-kv E2E testing'
description: 'This is a test action for testing the notation-azure-kv plugin on mltiple platforms.'
inputs:
who-to-greet: # id of input
description: 'Who to greet'
pluginDownloadURL:
description: 'Where to download the plugin'
required: true
pluginChecksum:
description: 'The checksum of the plugin'
required: true
default: 'World'
outputs:
random-number:
description: "Random number"
value: ${{ steps.random-number-generator.outputs.random-number }}
runs:
using: "composite"
steps:
- run: echo Hello ${{ inputs.who-to-greet }}.
shell: bash
- id: random-number-generator
run: echo "random-number=$(echo $RANDOM)" >> $GITHUB_OUTPUT
shell: bash
- run: echo "${{ github.action_path }}" >> $GITHUB_PATH
shell: bash
- run: goodbye.sh
shell: bash
- name: setup Notation CLI
uses: notaryproject/notation-action/setup@v1
with:
version: 1.0.1
- name: self-signed certificate
uses: notaryproject/notation-action/sign@v1
with:
plugin_name: azure-kv
plugin_url: ${{ inputs.plginDownloadURL }}
plugin_checksum: ${{ inputs.pluginChecksum }}
key_id: https://acrci-test-kv.vault.azure.net/keys/self-signed-pkcs12/70747b2064c0488e936eba7a29acc4c6
target_artifact_reference: localhost:5000/hello-world:v1
signature_format: cose
plugin_config: 'self_signed=true'
20 changes: 18 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,23 @@ jobs:
- name: Build bianry
run: ./scripts/build.sh v0.0.1 linux-x64
- name: Run download server locally
run: nohup python3 ./.github/e2e/e2e-server.py &
run: |
# start the server
nohup python3 ./.github/e2e/e2e-server.py &
# prepare the environment variables for E2E
artifactName=notation-azure-kv_0.0.1_linux_amd64.tar.gz
checksum=$(shasum -a 256 "./bin/artifacts/$artifactName" | awk '{print $1}')
echo "pluginChecksum=$checksum" >> $GITHUB_ENV
echo "pluginDownloadURL=http://localhost:8080/$artifactName" >> $GITHUB_ENV
- name: Prepare container registry
run: |
docker run --name registry --rm -d -p 5000:5000 registry:2
docker pull hello-world:latest
docker tag hello-world:latest localhost:5000/hello-world:v1
docker push localhost:5000/hello-world:v1
- uses: ./.github/e2e
with:
who-to-greet: 'Mona the Octocat'
pluginDownloadURL: ${{ env.pluginDownloadURL }}
pluginChecksum: ${{ env.pluginChecksum }}

0 comments on commit 450fedb

Please sign in to comment.