Skip to content

Commit

Permalink
GitHub Actions: use GitHub Artifact as EVE image if specified
Browse files Browse the repository at this point in the history
Previously, EVE images used for tests in PR were pushed to dockerhub.
This comes with several disadvantages, amongst them is dockerhub rate limit
and intermediate images published. Now we use GitHub artifacts instead. That
still gives you flexibility of downloading specific EVE images to test locally,
but removes dockerhub rate limit

Now action user can specify run id and artifact name which contains EVE image,
which could be pulled and used to run tests

Signed-off-by: Pavel Abramov <uncle.decart@gmail.com>
  • Loading branch information
uncleDecart committed Feb 5, 2024
1 parent e06311d commit 28d635c
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 5 deletions.
3 changes: 3 additions & 0 deletions .github/actions/run-eden-test/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ inputs:
type: string
eve_artifact_name:
type: string
artifact_run_id:
type: string

runs:
using: 'composite'
Expand All @@ -26,6 +28,7 @@ runs:
tpm_enabled: ${{ inputs.tpm_enabled }}
eve_image: ${{ inputs.eve_image }}
eve_artifact_name: ${{ inputs.eve_artifact_name }}
artifact_run_id: ${{ inputs.artifact_run_id }}
- name: Run tests
run: EDEN_TEST_STOP=n ./eden test ./tests/workflow -s ${{ inputs.suite }} -v debug
shell: bash
Expand Down
16 changes: 11 additions & 5 deletions .github/actions/setup-environment/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ inputs:
type: string
eve_artifact_name:
type: string
artifact_run_id:
type: string

runs:
using: 'composite'
Expand Down Expand Up @@ -56,14 +58,18 @@ runs:
shell: bash
working-directory: "./eden"
- name: Download artifact if specified
if: github.event.inputs.eve_artifact_name != ''
uses: actions/download-artifact@v3
if: inputs.eve_artifact_name != ''
uses: actions/download-artifact@v4
with:
name: inputs.eve_artifact_name
github-token: ${{ github.token }}
name: ${{ inputs.eve_artifact_name }}
path: artifacts # this is the directory where it will put the artifact, not its name
run-id: ${{ inputs.artifact_run_id }}
- name: Load containers to docker if specified
if: github.event.inputs.eve_artifact_name != ''
if: inputs.eve_artifact_name != ''
run: |
docker load -q -i ${{ inputs.eve_artifact_name }}.tar
docker load -q -i artifacts/${{ inputs.eve_artifact_name }}.tar
docker image ls
shell: bash
- name: Setup eve version
run: |
Expand Down
10 changes: 10 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,16 @@ on:
type: string
eve_artifact_name:
type: string
artifact_run_id:
type: string
workflow_call:
inputs:
eve_image:
type: string
eve_artifact_name:
type: string
artifact_run_id:
type: string

jobs:
determine-runner:
Expand Down Expand Up @@ -54,6 +58,7 @@ jobs:
suite: "smoke.tests.txt"
eve_image: ${{ inputs.eve_image }}
eve_artifact_name: ${{ inputs.eve_artifact_name }}
artifact_run_id: ${{ inputs.artifact_run_id }}

networking:
name: Networking test suite
Expand All @@ -73,6 +78,7 @@ jobs:
suite: "networking.tests.txt"
eve_image: ${{ inputs.eve_image }}
eve_artifact_name: ${{ inputs.eve_artifact_name }}
artifact_run_id: ${{ inputs.artifact_run_id }}

storage:
continue-on-error: true
Expand All @@ -96,6 +102,7 @@ jobs:
suite: "storage.tests.txt"
eve_image: ${{ inputs.eve_image }}
eve_artifact_name: ${{ inputs.eve_artifact_name }}
artifact_run_id: ${{ inputs.artifact_run_id }}

lpc-loc:
name: LPC LOC test suite
Expand All @@ -115,6 +122,7 @@ jobs:
suite: "lpc-loc.tests.txt"
eve_image: ${{ inputs.eve_image }}
eve_artifact_name: ${{ inputs.eve_artifact_name }}
artifact_run_id: ${{ inputs.artifact_run_id }}

eve-upgrade:
continue-on-error: true
Expand All @@ -138,6 +146,7 @@ jobs:
suite: "eve-upgrade.tests.txt"
eve_image: ${{ inputs.eve_image }}
eve_artifact_name: ${{ inputs.eve_artifact_name }}
artifact_run_id: ${{ inputs.artifact_run_id }}

user-apps:
name: User apps test suite
Expand All @@ -157,3 +166,4 @@ jobs:
suite: "user-apps.tests.txt"
eve_image: ${{ inputs.eve_image }}
eve_artifact_name: ${{ inputs.eve_artifact_name }}
artifact_run_id: ${{ inputs.artifact_run_id }}

0 comments on commit 28d635c

Please sign in to comment.