Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

e2e: added e2e workflows #35

Merged
merged 102 commits into from
Aug 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
102 commits
Select commit Hold shift + click to select a range
47faa2b
initial commit
Two-Hearts Aug 7, 2023
d5f01d2
initial commit
Two-Hearts Aug 7, 2023
0660c33
initial commit
Two-Hearts Aug 7, 2023
72c11c4
initial commit
Two-Hearts Aug 7, 2023
37a63bb
testing e2e workflow
Two-Hearts Aug 7, 2023
645c608
testing e2e workflow
Two-Hearts Aug 7, 2023
7ebc9b2
testing e2e workflow
Two-Hearts Aug 7, 2023
ca47bc5
testing e2e workflow
Two-Hearts Aug 7, 2023
73c6117
update
Two-Hearts Aug 8, 2023
a79194b
fail with wrong checksum
Two-Hearts Aug 8, 2023
1634678
updated e2e plugin checksum
Two-Hearts Aug 8, 2023
b4d7ed0
updated e2e plugin checksum
Two-Hearts Aug 8, 2023
6af02e0
update
Two-Hearts Aug 8, 2023
18a8016
fail setup
Two-Hearts Aug 8, 2023
b555a3b
testing e2e-setup
Two-Hearts Aug 8, 2023
ea90d57
testing e2e-setup
Two-Hearts Aug 8, 2023
7e18339
testing e2e-setup
Two-Hearts Aug 8, 2023
f57f338
added e2e-test-setup
Two-Hearts Aug 8, 2023
96deb75
added e2e-test-setup
Two-Hearts Aug 8, 2023
6b691a3
adding e2e test cases to sign
Two-Hearts Aug 8, 2023
086ea35
adding e2e test cases to sign
Two-Hearts Aug 8, 2023
2a33fbc
added e2e-test-sign
Two-Hearts Aug 8, 2023
0921c55
testing sign
Two-Hearts Aug 8, 2023
f649489
testing sign
Two-Hearts Aug 8, 2023
669d8ec
testing sign
Two-Hearts Aug 8, 2023
87e85c8
resolved conflicts
Two-Hearts Aug 9, 2023
242014c
fail plugin
Two-Hearts Aug 9, 2023
3f834ea
testing
Two-Hearts Aug 9, 2023
3b33115
testing e2e
Two-Hearts Aug 9, 2023
18f93a7
digest
Two-Hearts Aug 9, 2023
5006b4e
test
Two-Hearts Aug 9, 2023
82ebe0d
updated sign e2e
Two-Hearts Aug 9, 2023
59c8b14
update e2e
Two-Hearts Aug 9, 2023
35b9c4e
updated e2e
Two-Hearts Aug 9, 2023
dc38bf3
updated e2e
Two-Hearts Aug 9, 2023
165b90d
updated e2e
Two-Hearts Aug 9, 2023
962dc01
added verify e2e
Two-Hearts Aug 9, 2023
e4f1b85
added verify e2e
Two-Hearts Aug 9, 2023
de86dbe
added verify e2e
Two-Hearts Aug 9, 2023
1e2ad06
updated
Two-Hearts Aug 9, 2023
bb744ab
testing multiple os
Two-Hearts Aug 10, 2023
9acf5dd
testing multiple os runners
Two-Hearts Aug 10, 2023
7bf0302
update
Two-Hearts Aug 10, 2023
d9a8a6e
update
Two-Hearts Aug 10, 2023
0025c52
update
Two-Hearts Aug 10, 2023
eca8ecd
update
Two-Hearts Aug 10, 2023
045be61
update
Two-Hearts Aug 10, 2023
050b791
update
Two-Hearts Aug 10, 2023
7c31852
update
Two-Hearts Aug 10, 2023
d6dd9ef
test
Two-Hearts Aug 10, 2023
766fcde
test
Two-Hearts Aug 10, 2023
8ebe9b2
test
Two-Hearts Aug 10, 2023
092cdd1
test
Two-Hearts Aug 10, 2023
0528858
test
Two-Hearts Aug 10, 2023
aab1825
test
Two-Hearts Aug 10, 2023
f79189f
test
Two-Hearts Aug 10, 2023
34de028
test
Two-Hearts Aug 10, 2023
f54b7bc
test
Two-Hearts Aug 10, 2023
726f61e
test
Two-Hearts Aug 10, 2023
2fc4422
test
Two-Hearts Aug 10, 2023
1206d68
test
Two-Hearts Aug 10, 2023
c364475
test
Two-Hearts Aug 10, 2023
2081bc9
test
Two-Hearts Aug 10, 2023
9157926
updated e2e
Two-Hearts Aug 10, 2023
cc3d53a
resolved conflicts
Two-Hearts Aug 11, 2023
4ea7e0c
updated to use actions from main
Two-Hearts Aug 11, 2023
1532c1d
updated e2e tests
Two-Hearts Aug 11, 2023
4a8aade
updated e2e test
Two-Hearts Aug 11, 2023
195a5a7
updated E2E
Two-Hearts Aug 14, 2023
0468407
updated e2e
Two-Hearts Aug 14, 2023
7422a28
updated e2e
Two-Hearts Aug 14, 2023
9575554
updated e2e
Two-Hearts Aug 14, 2023
9c38cd4
updated e2e
Two-Hearts Aug 14, 2023
5d4abce
updated E2E
Two-Hearts Aug 14, 2023
0aa49f9
update
Two-Hearts Aug 14, 2023
0cdf6db
updated license checker
Two-Hearts Aug 15, 2023
7262460
update
Two-Hearts Aug 15, 2023
85cd246
testing
Two-Hearts Aug 15, 2023
4a4fae0
testing
Two-Hearts Aug 15, 2023
4e4f366
testing
Two-Hearts Aug 15, 2023
02e321e
testing
Two-Hearts Aug 15, 2023
420f926
testing
Two-Hearts Aug 15, 2023
9efe62c
testing
Two-Hearts Aug 15, 2023
c0c4e05
testing
Two-Hearts Aug 15, 2023
fb2970f
testing
Two-Hearts Aug 15, 2023
7eeafce
testing
Two-Hearts Aug 15, 2023
f3e4f72
testing
Two-Hearts Aug 15, 2023
229a473
testing
Two-Hearts Aug 15, 2023
3912b97
testing
Two-Hearts Aug 15, 2023
83321dc
testing
Two-Hearts Aug 15, 2023
2323fd4
testing verify
Two-Hearts Aug 15, 2023
2336732
testing verify
Two-Hearts Aug 15, 2023
793bce0
testing verify
Two-Hearts Aug 15, 2023
375adb0
testing verify
Two-Hearts Aug 15, 2023
f27c95a
updated plugin url
Two-Hearts Aug 15, 2023
a434659
updated plugin checksum
Two-Hearts Aug 16, 2023
e8c0b05
updated plugin checksum
Two-Hearts Aug 16, 2023
d5f7d89
adding test cases
Two-Hearts Aug 16, 2023
827386f
updated verify
Two-Hearts Aug 16, 2023
12ee62b
updated per code review
Two-Hearts Aug 17, 2023
0248c4b
updated per code review
Two-Hearts Aug 17, 2023
1ca206d
updated per code review
Two-Hearts Aug 18, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/licenserc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ header:
- 'tsconfig.json'
- '**/data/**'
- 'dist'
- 'tests'

comment: on-failure

Expand Down
85 changes: 85 additions & 0 deletions .github/workflows/e2e-test-setup.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
# Copyright The Notary Project Authors.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

name: e2e-test-setup

on:
push:
pull_request:

jobs:
e2e-test-setup:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

# E2E test cases on Notation: Setup
- name: Setup Notation
uses: ./setup

- name: Setup Notation using unsupported version
id: unsupported-version
continue-on-error: true
uses: ./setup
with:
version: unsupported
- name: 'Should Fail: Setup Notation using unsupported version'
if: steps.unsupported-version.outcome != 'failure'
run: |
echo "Setup Notation using unsupported version should fail, but succeeded."
exit 1

- name: Setup Notation using URL
uses: ./setup
with:
url: https://github.com/notaryproject/notation/releases/download/v1.0.0-rc.6/notation_1.0.0-rc.6_linux_amd64.tar.gz
checksum: bca21002cfb611f9ffc2930e88ecdb74471806770d0c64d45e39f4971692bcf5

- name: Setup Notation using URL without checksum
id: no-checksum
continue-on-error: true
uses: ./setup
with:
url: https://github.com/notaryproject/notation/releases/download/v1.0.0-rc.6/notation_1.0.0-rc.6_linux_amd64.tar.gz
- name: 'Should Fail: Setup Notation using URL without checksum'
if: steps.no-checksum.outcome != 'failure'
run: |
echo "Setup Notation using URL without checksum should fail, but succeeded."
exit 1

- name: Setup Notation using URL and invalid checksum
id: invalid-checksum
continue-on-error: true
uses: ./setup
with:
url: https://github.com/notaryproject/notation/releases/download/v1.0.0-rc.6/notation_1.0.0-rc.6_linux_amd64.tar.gz
checksum: abcedf
- name: 'Should Fail: Setup Notation using URL and invalid checksum'
if: steps.invalid-checksum.outcome != 'failure'
run: |
echo "Setup Notation using URL and invalid checksum should fail, but succeeded."
exit 1

- name: Setup Notation using invalid URL
id: invalid-url
continue-on-error: true
uses: ./setup
with:
url: invalid-url
checksum: test
- name: 'Should Fail: Setup Notation using invalid URL'
if: steps.invalid-url.outcome != 'failure'
run: |
echo "Setup Notation using invalid URL should fail, but succeeded."
exit 1
198 changes: 198 additions & 0 deletions .github/workflows/e2e-test-sign.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,198 @@
# Copyright The Notary Project Authors.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

name: e2e-test-sign

on:
push:
pull_request:

env:
E2E_KEY: /home/runner/.config/notation/localkeys/e2e-test.key
E2E_CERT: /home/runner/.config/notation/localkeys/e2e-test.crt

jobs:
e2e-test-sign:
runs-on: ubuntu-latest
services:
registry:
image: registry:2
ports:
- 5000:5000
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Build and push to local registry
id: prepare
uses: docker/build-push-action@v4
with:
context: ./tests/e2e
push: true
tags: localhost:5000/e2e:latest
- name: Retrieve digest
run: |
echo "target_artifact_reference=localhost:5000/e2e@${{ steps.prepare.outputs.digest }}" >> "$GITHUB_ENV"

# Setting up Notation CLI on the runner
- name: Setup Notation
uses: ./setup

# Generate test
- name: Notation generate-test
run: |
notation cert generate-test "e2e-test"

# E2E test cases on Notation: Sign
- name: Sign artifact using notation plugin
uses: ./sign
with:
plugin_name: e2e-test-plugin
plugin_url: https://github.com/notaryproject/notation-action/raw/e2e-test-plugin/tests/plugin_binaries/notation-e2e-test-plugin_0.1.0_linux_amd64.tar.gz
plugin_checksum: be8d035024d3a96afb4118af32f2e201f126c7254b02f7bcffb3e3149d744fd2
key_id: ${{ env.E2E_CERT }}
target_artifact_reference: ${{ env.target_artifact_reference }}
signature_format: cose
plugin_config: |-
keyFile=${{ env.E2E_KEY }}

- name: Sign artifact with multiple plugin_config
uses: ./sign
env:
E2E_SIGNING_KEY: ${{ secrets.E2E_SIGNING_KEY }}
with:
plugin_name: e2e-test-plugin
plugin_url: https://github.com/notaryproject/notation-action/raw/e2e-test-plugin/tests/plugin_binaries/notation-e2e-test-plugin_0.1.0_linux_amd64.tar.gz
plugin_checksum: be8d035024d3a96afb4118af32f2e201f126c7254b02f7bcffb3e3149d744fd2
key_id: ${{ env.E2E_CERT }}
target_artifact_reference: ${{ env.target_artifact_reference }}
signature_format: cose
plugin_config: |-
keyFile=${{ env.E2E_KEY }}
key=val
foo=bar

- name: Sign artifact with invalid plugin name
continue-on-error: true
id: invalid-plugin-name
uses: ./sign
env:
E2E_SIGNING_KEY: ${{ secrets.E2E_SIGNING_KEY }}
with:
plugin_name: invalid-plugin
plugin_url: https://github.com/notaryproject/notation-action/raw/e2e-test-plugin/tests/plugin_binaries/notation-e2e-test-plugin_0.1.0_linux_amd64.tar.gz
plugin_checksum: be8d035024d3a96afb4118af32f2e201f126c7254b02f7bcffb3e3149d744fd2
key_id: ${{ env.E2E_CERT }}
target_artifact_reference: ${{ env.target_artifact_reference }}
signature_format: cose
plugin_config: |-
keyFile=${{ env.E2E_KEY }}
- name: 'Should Fail: Sign artifact with invalid plugin name'
if: steps.invalid-plugin-name.outcome != 'failure'
run: |
echo "Sign artifact with invalid plugin name should fail, but succeeded."
exit 1

- name: Sign artifact with invalid plugin url
continue-on-error: true
id: invalid-plugin-url
uses: ./sign
env:
E2E_SIGNING_KEY: ${{ secrets.E2E_SIGNING_KEY }}
with:
plugin_name: test
plugin_url: invalid-url
plugin_checksum: test
key_id: ${{ env.E2E_CERT }}
target_artifact_reference: ${{ env.target_artifact_reference }}
signature_format: cose
plugin_config: |-
keyFile=${{ env.E2E_KEY }}
- name: 'Should Fail: Sign artifact with invalid plugin url'
if: steps.invalid-plugin-url.outcome != 'failure'
run: |
echo "Sign artifact with invalid plugin url should fail, but succeeded."
exit 1

- name: Sign artifact missing plugin checksum
continue-on-error: true
id: missing-plugin-checksum
uses: ./sign
with:
plugin_name: test
plugin_url: https://github.com/notaryproject/notation-action/raw/e2e-test-plugin/tests/plugin_binaries/notation-e2e-test-plugin_0.1.0_linux_amd64.tar.gz
key_id: ${{ env.E2E_CERT }}
target_artifact_reference: ${{ env.target_artifact_reference }}
signature_format: cose
plugin_config: |-
keyFile=${{ env.E2E_KEY }}
- name: 'Should Fail: Sign artifact missing plugin checksum'
if: steps.missing-plugin-checksum.outcome != 'failure'
run: |
echo "Sign artifact missing plugin checksum should fail, but succeeded."
exit 1

- name: Sign artifact with invalid plugin checksum
continue-on-error: true
id: invalid-plugin-checksum
uses: ./sign
env:
E2E_SIGNING_KEY: ${{ secrets.E2E_SIGNING_KEY }}
with:
plugin_name: test
plugin_url: https://github.com/notaryproject/notation-action/raw/e2e-test-plugin/tests/plugin_binaries/notation-e2e-test-plugin_0.1.0_linux_amd64.tar.gz
plugin_checksum: abcdef
key_id: ${{ env.E2E_CERT }}
target_artifact_reference: ${{ env.target_artifact_reference }}
signature_format: cose
plugin_config: |-
keyFile=${{ env.E2E_KEY }}
- name: 'Should Fail: Sign artifact with invalid plugin checksum'
if: steps.invalid-plugin-checksum.outcome != 'failure'
run: |
echo "Sign artifact with invalid plugin checksum should fail, but succeeded."
exit 1

- name: Sign artifact missing key id
continue-on-error: true
id: missing-key-id
uses: ./sign
env:
E2E_SIGNING_KEY: ${{ secrets.E2E_SIGNING_KEY }}
with:
plugin_name: test
plugin_url: https://test
plugin_checksum: abcdef
target_artifact_reference: test
- name: 'Should Fail: Sign artifact missing key id'
if: steps.missing-key-id.outcome != 'failure'
run: |
echo "Sign artifact missing key id should fail, but succeeded."
exit 1

- name: Sign artifact missing target artifact reference
continue-on-error: true
id: missing-artifact-reference
uses: notaryproject/notation-action/sign@main
env:
E2E_SIGNING_KEY: ${{ secrets.E2E_SIGNING_KEY }}
with:
plugin_name: test
plugin_url: https://test
plugin_checksum: abcdef
key_id: test
- name: 'Should Fail: Sign artifact missing target artifact reference'
if: steps.missing-artifact-reference.outcome != 'failure'
run: |
echo "Sign artifact missing target artifact reference should fail, but succeeded."
exit 1

Loading