diff --git a/.github/workflows/spdk-common-tests.yml b/.github/workflows/spdk-common-tests.yml index cfb0cfd..42e918e 100644 --- a/.github/workflows/spdk-common-tests.yml +++ b/.github/workflows/spdk-common-tests.yml @@ -82,7 +82,7 @@ jobs: freebsd_14=$(gh api --paginate "/repos/${{ github.repository }}/actions/artifacts?name=vm-image-freebsd_14_x86_64" -q '.artifacts |= sort_by(.updated_at)[-1] | .artifacts.workflow_run.id') [[ -z "${fedora_43}" ]] && echo "fedora_43 is empty" && exit 1 [[ -z "${freebsd_14}" ]] && echo "freebsd_14 is empty" && exit 1 - echo "artifact_id={'fedora_43':$fedora_43,'freebsd_14':$freebsd_14}" >> "$GITHUB_OUTPUT" + echo "artifact_id={\"fedora_43\":$fedora_43,\"freebsd_14\":$freebsd_14}" >> "$GITHUB_OUTPUT" outputs: artifact_id: ${{ steps.get_artifact_id.outputs.artifact_id }} @@ -200,6 +200,7 @@ jobs: CI_CFGS_REPOSITORY_PATH: ${{ github.workspace }}/ci/cijoe/configs/autorun_configs NVME_SETUP: ${{ matrix.nvme_setup }} DISTRO: ${{ matrix.distro }} + GITHUB_WORKSPACE: ${{ github.workspace }} # TODO: Figure out how to pass volumes variable to container context container: @@ -273,7 +274,7 @@ jobs: matrix.distro)) == '' with: name: vm-image-${{matrix.distro}}_x86_64 - github-token: ${{ github.token }} + github-token: ${{ ! contains(github.actor, 'nektos/act') && github.token || '' }} run-id: ${{ fromJson(needs.checkout_spdk.outputs.artifact_id)[ matrix.distro ] }} - name: qemu-guest, initialize @@ -311,7 +312,7 @@ jobs: --monitor - name: qemu-guest, shutdown - if: ${{ contains(matrix.workflow.name, 'vm') && contains(runner.labels, 'self-hosted') || env.ACT == 'true' }} + if: contains(matrix.workflow.name, 'vm') && contains(runner.labels,'self-hosted') && ! contains(github.actor, 'nektos/act') run: | cd ci/cijoe cijoe workflows/autorun.yaml guest_shutdown \ diff --git a/README.md b/README.md index 3447d9a..ed770cb 100644 --- a/README.md +++ b/README.md @@ -91,3 +91,17 @@ run a workflow using repository_dispatch event (example events provided in `.git ``` for more examples, visit + +Some of the workflow (like for example build_docker.yml or gerrit-false-positives-handler.yml) require the GitHub CLI to be installed, +which is not included in the default act containers (e.g. catthehacker/ubuntu:act-latest). To run these workflows and not encounter +"command not found" errors, you can use the Dockerfile in `act` directory: + +```bash +docker build -t spdk-act ./act +``` + +and then use this image to replace the default act image during workflow execution: + +```bash +gh act -P ubuntu-latest=spdk-act:latest --job build-docker --input distro=fedora_43 +``` diff --git a/act/Dockerfile b/act/Dockerfile new file mode 100644 index 0000000..14174eb --- /dev/null +++ b/act/Dockerfile @@ -0,0 +1,2 @@ +FROM catthehacker/ubuntu:act-latest +RUN apt-get update && apt-get install -y gh diff --git a/cijoe/configs/qemuhost-with-guest-fedora_43.toml b/cijoe/configs/qemuhost-with-guest-fedora_43.toml index 120f9dc..f805f11 100644 --- a/cijoe/configs/qemuhost-with-guest-fedora_43.toml +++ b/cijoe/configs/qemuhost-with-guest-fedora_43.toml @@ -46,7 +46,6 @@ cloud.url = "https://ftp.uni-stuttgart.de/fedora/releases/43/Cloud/x86_64/images cloud.path = "{{ local.env.HOME }}/system_imaging/cloud/Fedora-Cloud-Base-Generic-43-1.6.x86_64.qcow2" cloud.metadata_path = "{{ resources.auxiliary['system_imaging.cloudinit-linux-common-metadata'] }}" cloud.userdata_path = "{{ resources.auxiliary['system_imaging.cloudinit-linux-common-userdata'] }}" -# disk.path = "{{ local.env.HOME }}/system_imaging/disk/fedora_43_x86_64.qcow2" -disk.path = "/__w/spdk-ci/spdk-ci/fedora_43_x86_64.qcow2" +disk.path = "{{ local.env.GITHUB_WORKSPACE }}/fedora_43_x86_64.qcow2" docker.name = "spdk-ci" docker.tag = "fedora_43" diff --git a/cijoe/configs/qemuhost-with-guest-freebsd_14.toml b/cijoe/configs/qemuhost-with-guest-freebsd_14.toml index 7fe1732..b8ef174 100644 --- a/cijoe/configs/qemuhost-with-guest-freebsd_14.toml +++ b/cijoe/configs/qemuhost-with-guest-freebsd_14.toml @@ -49,7 +49,6 @@ cloud.url = "https://object-storage.public.mtl1.vexxhost.net/swift/v1/1dbafeefbd cloud.path = "{{ local.env.HOME }}/system_imaging/cloud/freebsd-14.2-zfs-2024-12-08.qcow2" cloud.metadata_path = "{{ resources.auxiliary['system_imaging.cloudinit-freebsd-metadata'] }}" cloud.userdata_path = "{{ resources.auxiliary['system_imaging.cloudinit-freebsd-userdata'] }}" -# disk.path = "{{ local.env.HOME }}/system_imaging/disk/freebsd_14_x86_64.qcow2" -disk.path = "/__w/spdk-ci/spdk-ci/freebsd_14_x86_64.qcow2" +disk.path = "{{ local.env.GITHUB_WORKSPACE }}/freebsd_14_x86_64.qcow2" docker.name = "spdk-ci" docker.tag = "freebsd_14" diff --git a/cijoe/workflows/build_fedora_qcow2_using_qemu.yaml b/cijoe/workflows/build_fedora_qcow2_using_qemu.yaml index 943eb2e..c46fce3 100644 --- a/cijoe/workflows/build_fedora_qcow2_using_qemu.yaml +++ b/cijoe/workflows/build_fedora_qcow2_using_qemu.yaml @@ -54,7 +54,7 @@ steps: - name: guest_update run: | dnf update -y - dnf install -y git perl-JSON-PP + dnf install -y git perl-JSON-PP nodejs dnf autoremove -y dnf clean all -y diff --git a/cijoe/workflows/build_freebsd_14_qcow2_using_qemu.yaml b/cijoe/workflows/build_freebsd_14_qcow2_using_qemu.yaml index 4616148..102c851 100644 --- a/cijoe/workflows/build_freebsd_14_qcow2_using_qemu.yaml +++ b/cijoe/workflows/build_freebsd_14_qcow2_using_qemu.yaml @@ -58,7 +58,7 @@ steps: - name: guest_update run: | - pkg install -y git + pkg install -y git nodejs - name: kernel_src run: |