diff --git a/.github/actions/create-guest-image/action.yml b/.github/actions/create-guest-image/action.yml index 48d6615d4..55a8a5bb2 100644 --- a/.github/actions/create-guest-image/action.yml +++ b/.github/actions/create-guest-image/action.yml @@ -2,9 +2,6 @@ name: 'Create guest image' description: 'Create VM guest image on Ubuntu runner' inputs: - packages: - description: 'Packages to install in guest image' - required: true distro: description: 'Linux distribution to use for guest image' required: false @@ -35,6 +32,8 @@ runs: --append-line '/etc/environment:GITHUB_REPOSITORY=${{ github.repository }}' \ --append-line '/etc/environment:GITHUB_REF=${{ github.ref }}' \ --append-line '/etc/environment:GITHUB_SHA=${{ github.sha }}' \ - --install ${{ inputs.packages }} + --append-line '/etc/environment:CI_TARGET_BUILD=${{ env.CI_TARGET_BUILD }}' \ + --append-line '/etc/environment:CI_TARGET_OS=${{ env.CI_TARGET_OS }}' + shell: bash diff --git a/.github/actions/start-vm/action.yml b/.github/actions/start-vm/action.yml index 77e2a6ac7..5f69e33ee 100644 --- a/.github/actions/start-vm/action.yml +++ b/.github/actions/start-vm/action.yml @@ -18,6 +18,9 @@ inputs: host_key: # If true add guest host key to known_hosts required: false default: "false" + install_fio_deps: # If true install dependencies for building fio + required: false + default: "false" build_fio: # If true clone and build fio on guest required: false default: "false" @@ -57,12 +60,32 @@ runs: shell: bash env: SSHCMD: ssh root@localhost -p ${{ inputs.ssh_fwd_port }} - - name: Clone and build fio on guest # fake a GHA environment to use checkout-action + - name: Clone fio on guest # fake a GHA environment to use checkout-action run: | if echo ${{ inputs.build_fio }} | grep -c "true" then + $SSHCMD "apt-get install -qq git" $SSHCMD "git clone https://github.com/taiki-e/checkout-action --branch v1.3.0" - $SSHCMD "mkdir fio && cd fio && ../checkout-action/main.sh && git log -1 && make -j $(nproc)" + $SSHCMD "mkdir fio && cd fio && ../checkout-action/main.sh && git log -1" + fi + shell: bash + env: + SSHCMD: ssh root@localhost -p ${{ inputs.ssh_fwd_port }} + - name: Install fio dependencies # fake a GHA environment + run: | + if echo ${{ inputs.build_fio }} | grep -c "true" + then + $SSHCMD "apt install -qq sudo" + $SSHCMD "cd fio && ./ci/actions-install.sh" + fi + shell: bash + env: + SSHCMD: ssh root@localhost -p ${{ inputs.ssh_fwd_port }} + - name: Build fio on guest + run: | + if echo ${{ inputs.build_fio }} | grep -c "true" + then + $SSHCMD "cd fio && git log -1 && make -j $(nproc)" fi shell: bash env: diff --git a/.github/workflows/qemu.yml b/.github/workflows/qemu.yml index 17aae85e3..a1f986b0c 100644 --- a/.github/workflows/qemu.yml +++ b/.github/workflows/qemu.yml @@ -46,8 +46,9 @@ jobs: env: DISTRO: debian-12 - PKGS: git,libaio-dev,libcunit1-dev,libcurl4-openssl-dev,libfl-dev,libnuma-dev,libnfs-dev,valgrind,libglusterfs-dev,libgoogle-perftools-dev,libiscsi-dev,libnbd-dev,libpmem-dev,libpmem2-dev,libprotobuf-c-dev,librbd-dev,libtcmalloc-minimal4,libibverbs-dev,librdmacm-dev,nvme-cli,pkgconf,python3-scipy,python3-sphinx,python3-statsmodels,bison,build-essential,cmake,flex,unzip,wget,zlib1g-dev,sudo SSHCMD: ssh root@localhost -p 2022 + CI_TARGET_BUILD: linux + CI_TARGET_OS: debian steps: - name: Check out repository @@ -57,18 +58,19 @@ jobs: uses: ./.github/actions/create-guest-image with: distro: ${{ env.DISTRO }} - packages: ${{ env.PKGS }} - name: Build and install QEMU uses: ./.github/actions/build-qemu - name: Create backing file for NVMe device run: truncate -s 1G nvme0.img + - name: Start VM and clone/build fio uses: ./.github/actions/start-vm with: image: ${{ env.DISTRO }}.img host_key: true + install_fio_deps: true build_fio: true options: ${{ matrix.device }}