Skip to content

Commit

Permalink
Merge pull request #1 from ishworkh/add_download_functionality
Browse files Browse the repository at this point in the history
Add modified codes and workflows
  • Loading branch information
ishworkh committed Jun 30, 2023
2 parents c596125 + 6d15322 commit f3c93e1
Show file tree
Hide file tree
Showing 14 changed files with 3,773 additions and 3 deletions.
89 changes: 89 additions & 0 deletions .github/workflows/docker-e2e-from-workflow.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
name: Docker - E2E Download Image From Another Workflow
on:
pull_request:
types:
- opened
- reopened
- synchronize
branches:
- "main"
jobs:
test_download_no_filters:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v3

- name: Download image
uses: ./
with:
image: "${{ vars.IMAGE_NAME }}:${{ vars.IMAGE_TAG }}"
repository: "${{ vars.SOURCE_REPOSITORY }}"
workflow: "${{ vars.WORKFLOW_NAME }}"
token: "${{ secrets.ARTIFACT_DOWNLOADER_TOKEN }}"

- name: Test docker image is present
run: |
docker image inspect ${{ vars.IMAGE_NAME }}:${{ vars.IMAGE_TAG }}
test_download_filter_run_id:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v3

- name: Download image
uses: ./
with:
image: "${{ vars.IMAGE_NAME }}:${{ vars.IMAGE_TAG }}"
repository: "${{ vars.SOURCE_REPOSITORY }}"
workflow: "${{ vars.WORKFLOW_NAME }}"
token: "${{ secrets.ARTIFACT_DOWNLOADER_TOKEN }}"
workflow_run_id: "${{ vars.WORKFLOW_RUN_ID }}"
workflow_event: "RandomNoEffect"
commit_sha: "noeffecteither"

- name: Test docker image is present
run: |
docker image inspect ${{ vars.IMAGE_NAME }}:${{ vars.IMAGE_TAG }}
test_download_other_filters:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v3

- name: Download image
uses: ./
with:
image: "${{ vars.IMAGE_NAME }}:${{ vars.IMAGE_TAG }}"
repository: "${{ vars.SOURCE_REPOSITORY }}"
workflow: "${{ vars.WORKFLOW_NAME }}"
token: "${{ secrets.ARTIFACT_DOWNLOADER_TOKEN }}"
workflow_event: "${{ vars.WORKFLOW_EVENT }}"
branch: "${{ vars.BRANCH }}"
commit_sha: "${{ vars.COMMIT_SHA }}"
workflow_conclusion: "${{ vars.WORKFLOW_CONCLUSION }}"

- name: Test docker image is present
run: |
docker image inspect ${{ vars.IMAGE_NAME }}:${{ vars.IMAGE_TAG }}
test_download_filter_failed_conclusion:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v3

- name: Download image
uses: ./
with:
image: "${{ vars.IMAGE_NAME }}:${{ vars.IMAGE_TAG }}"
repository: "${{ vars.SOURCE_REPOSITORY }}"
workflow: "${{ vars.WORKFLOW_NAME }}"
token: "${{ secrets.ARTIFACT_DOWNLOADER_TOKEN }}"
workflow_conclusion: "${{ vars.FAILED_WORKFLOW_CONCLUSION }}"

- name: Test docker image is present
run: |
docker image inspect ${{ vars.IMAGE_NAME }}:${{ vars.IMAGE_TAG }}
40 changes: 40 additions & 0 deletions .github/workflows/docker-e2e.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Docker - E2E Test
on:
pull_request:
types:
- opened
- reopened
- synchronize
branches:
- "main"
jobs:
upload-test-image:
runs-on: ubuntu-latest
steps:
- name: Build test image
run: |
docker build -t test_image:${{ github.run_id }} -<<EOF
FROM busybox
RUN touch abc.txt
EOF
- name: Upload image
uses: ishworkh/container-image-artifact-upload@v1.0.0
with:
image: "test_image:${{ github.run_id }}"

run-e2e-test:
needs: upload-test-image
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v3

- name: Download image
uses: ./
with:
image: "test_image:${{ github.run_id }}"

- name: Test docker image is present
run: |
docker image inspect test_image:${{ github.run_id }}
93 changes: 93 additions & 0 deletions .github/workflows/podman-e2e-from-workflow.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
name: Podman - E2E Download Image From Another Workflow
on:
pull_request:
types:
- opened
- reopened
- synchronize
branches:
- "main"
jobs:
test_download_no_filters:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v3

- name: Download image
uses: ./
with:
image: "${{ vars.IMAGE_NAME }}:${{ vars.IMAGE_TAG }}"
container_engine: "podman"
repository: "${{ vars.SOURCE_REPOSITORY }}"
workflow: "${{ vars.WORKFLOW_NAME }}"
token: "${{ secrets.ARTIFACT_DOWNLOADER_TOKEN }}"

- name: Test podman image is present
run: |
podman image inspect ${{ vars.IMAGE_NAME }}:${{ vars.IMAGE_TAG }}
test_download_filter_run_id:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v3

- name: Download image
uses: ./
with:
image: "${{ vars.IMAGE_NAME }}:${{ vars.IMAGE_TAG }}"
container_engine: "podman"
repository: "${{ vars.SOURCE_REPOSITORY }}"
workflow: "${{ vars.WORKFLOW_NAME }}"
token: "${{ secrets.ARTIFACT_DOWNLOADER_TOKEN }}"
workflow_run_id: "${{ vars.WORKFLOW_RUN_ID }}"
workflow_event: "RandomNoEffect"
commit_sha: "noeffecteither"

- name: Test podman image is present
run: |
podman image inspect ${{ vars.IMAGE_NAME }}:${{ vars.IMAGE_TAG }}
test_download_other_filters:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v3

- name: Download image
uses: ./
with:
image: "${{ vars.IMAGE_NAME }}:${{ vars.IMAGE_TAG }}"
container_engine: "podman"
repository: "${{ vars.SOURCE_REPOSITORY }}"
workflow: "${{ vars.WORKFLOW_NAME }}"
token: "${{ secrets.ARTIFACT_DOWNLOADER_TOKEN }}"
workflow_event: "${{ vars.WORKFLOW_EVENT }}"
branch: "${{ vars.BRANCH }}"
commit_sha: "${{ vars.COMMIT_SHA }}"
workflow_conclusion: "${{ vars.WORKFLOW_CONCLUSION }}"

- name: Test podman image is present
run: |
podman image inspect ${{ vars.IMAGE_NAME }}:${{ vars.IMAGE_TAG }}
test_download_filter_failed_conclusion:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v3

- name: Download image
uses: ./
with:
image: "${{ vars.IMAGE_NAME }}:${{ vars.IMAGE_TAG }}"
container_engine: "podman"
repository: "${{ vars.SOURCE_REPOSITORY }}"
workflow: "${{ vars.WORKFLOW_NAME }}"
token: "${{ secrets.ARTIFACT_DOWNLOADER_TOKEN }}"
workflow_conclusion: "${{ vars.FAILED_WORKFLOW_CONCLUSION }}"

- name: Test podman image is present
run: |
podman image inspect ${{ vars.IMAGE_NAME }}:${{ vars.IMAGE_TAG }}
42 changes: 42 additions & 0 deletions .github/workflows/podman-e2e.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Podman - E2E Test
on:
pull_request:
types:
- opened
- reopened
- synchronize
branches:
- "main"
jobs:
upload-test-image:
runs-on: ubuntu-latest
steps:
- name: Build test image
run: |
podman build -t test_image:${{ github.run_id }} -<<EOF
FROM busybox
RUN touch abc.txt
EOF
- name: Upload image
uses: ishworkh/container-image-artifact-upload@v1.0.0
with:
image: "test_image:${{ github.run_id }}"
container_engine: "podman"

run-e2e-test:
needs: upload-test-image
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v3

- name: Download image
uses: ./
with:
image: "test_image:${{ github.run_id }}"
container_engine: "podman"

- name: Test podman image is present
run: |
podman image inspect test_image:${{ github.run_id }}
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ out

# Nuxt.js build / generate output
.nuxt
dist

# Gatsby files
.cache/
Expand Down
Loading

0 comments on commit f3c93e1

Please sign in to comment.