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

gha: add neoeden job to test.yml workflow #1045

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
86 changes: 86 additions & 0 deletions .github/actions/run-neoeden-test/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
name: 'Run Neo-Eden test workflow'
description: 'Setup Eden, run go test and publish logs'

inputs:
file_system:
required: true
type: string
tpm_enabled:
required: true
type: bool
eve_image:
type: string
eve_log_level:
type: string
required: false
default: 'info'
eve_artifact_name:
type: string
artifact_run_id:
type: string
require_virtualization:
type: bool
docker_account: # if not provided: use anonymous docker user
type: string
required: false
default: ''
docker_token:
type: string
required: false
default: ''
aziot_id_scope:
description: 'Azure IoT ID scope'
required: false
aziot_connection_string:
description: 'Azure IoT connection string'
required: false


runs:
using: 'composite'
steps:
- name: Collect Workflow Telemetry
uses: catchpoint/workflow-telemetry-action@v2
with:
proc_trace_sys_enable: true
comment_on_pr: false
- name: Login to Docker Hub
if: inputs.docker_account != ''
uses: docker/login-action@v3
with:
username: ${{ inputs.docker_account }}
password: ${{ inputs.docker_token }}
- name: Setup Environment
uses: ./eden/.github/actions/setup-environment
with:
file_system: ${{ inputs.file_system }}
tpm_enabled: ${{ inputs.tpm_enabled }}
eve_image: ${{ inputs.eve_image }}
eve_log_level: ${{ inputs.eve_log_level }}
eve_artifact_name: ${{ inputs.eve_artifact_name }}
artifact_run_id: ${{ inputs.artifact_run_id }}
require_virtualization: ${{ inputs.require_virtualization }}
- name: Run security tests
run: cd tests/sec && go test
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

kudos to @shjala for the following comment:
why don't we put all commands calling the tests in this workflow in a bash script and call that script from here

Advantages:

  • you don't need to change GHA every time you add a new test - you add it to that workflow bash script instead
  • your newly added tests run immediately on the PR you added them in, because there is no change to the GHA itself

Disadvantages:

  • some security concerns about the latter advantage and how people might change the bash script on their PR

shell: bash
working-directory: "./eden"
env:
AZIOT_ID_SCOPE: ${{ inputs.aziot_id_scope }}
AZIOT_CONNECTION_STRING: ${{ inputs.aziot_connection_string }}
- name: Collect info
if: failure()
uses: ./eden/.github/actions/collect-info
- name: Collect logs
if: always()
uses: ./eden/.github/actions/publish-logs
with:
report_name: eden-report-${{ inputs.suite }}-tpm-${{ inputs.tpm_enabled }}-${{ inputs.file_system }}
- name: Clean up after test
if: always()
run: |
./eden stop
make clean >/dev/null
docker system prune -f -a >/dev/null
shell: bash
working-directory: "./eden"

31 changes: 31 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -238,3 +238,34 @@ jobs:
require_virtualization: true
docker_account: ${{ secrets.RELEASE_DOCKERHUB_ACCOUNT }}
docker_token: ${{ secrets.RELEASE_DOCKERHUB_TOKEN }}

neoeden:
continue-on-error: true
strategy:
fail-fast: false
matrix:
file_system: ['ext4', 'zfs']
tpm: [true, false]
name: NeoEden (golang only) tests
needs: determine-runner
runs-on: ${{ fromJSON(needs.determine-runner.outputs.runner) }}
steps:
- name: Get code
uses: actions/[email protected]
with:
repository: "lf-edge/eden"
ref: ${{ inputs.eden_version }}
path: "./eden"
- name: Run Smoke tests
uses: ./eden/.github/actions/run-neoeden-test
with:
file_system: ${{ matrix.file_system }}
tpm_enabled: ${{ matrix.tpm }}
eve_image: ${{ inputs.eve_image }}
eve_log_level: ${{ inputs.eve_log_level }}
eve_artifact_name: ${{ inputs.eve_artifact_name }}
artifact_run_id: ${{ inputs.artifact_run_id }}
docker_account: ${{ secrets.RELEASE_DOCKERHUB_ACCOUNT }}
docker_token: ${{ secrets.RELEASE_DOCKERHUB_TOKEN }}
aziot_id_scope: ${{ secrets.AZIOT_ID_SCOPE }}
aziot_connection_string: ${{ secrets.AZIOT_CONNECTION_STRING }}
Loading