Skip to content

Commit 5be2a4e

Browse files
committed
feat: add prepare-rock-for-testing action
1 parent 27d800d commit 5be2a4e

1 file changed

Lines changed: 47 additions & 0 deletions

File tree

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Prepare rock for testing
2+
description: Decrypts an OCI archive artifact and converts it to an OCI layout.
3+
4+
inputs:
5+
artifact-name:
6+
description: Name of the encrypted OCI archive artifact.
7+
required: true
8+
passphrase:
9+
description: Passphrase used to decrypt the artifact.
10+
required: true
11+
test-image-name:
12+
description: Name of the output OCI layout.
13+
default: test-img
14+
test-image-tag:
15+
description: Tag in the output OCI layout.
16+
default: test
17+
18+
runs:
19+
using: composite
20+
steps:
21+
- name: Download Rock
22+
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c
23+
with:
24+
name: ${{ inputs.artifact-name }}
25+
26+
- name: Decrypt Rock
27+
uses: ./.github/actions/crypt-artifact
28+
with:
29+
mode: decrypt
30+
passphrase: ${{ inputs.passphrase }}
31+
input-path: ${{ inputs.artifact-name }}.gpg
32+
output-path: ${{ inputs.artifact-name }}
33+
preserve-original: false
34+
35+
- name: Convert Rock to OCI layout
36+
shell: bash
37+
env:
38+
ARTIFACT_NAME: ${{ inputs.artifact-name }}
39+
SKOPEO_IMAGE: quay.io/skopeo/stable:v1.20.0
40+
TEST_IMAGE_NAME: ${{ inputs.test-image-name }}
41+
TEST_IMAGE_TAG: ${{ inputs.test-image-tag }}
42+
run: |
43+
docker run --rm -v /var/run/docker.sock:/var/run/docker.sock \
44+
-v "$PWD:/workdir" -w /workdir \
45+
"${SKOPEO_IMAGE}" \
46+
copy "oci-archive:${ARTIFACT_NAME}" \
47+
"oci:${TEST_IMAGE_NAME}:${TEST_IMAGE_TAG}"

0 commit comments

Comments
 (0)