Skip to content

Commit

Permalink
ci: use ci/actions-install.sh to install dependencies
Browse files Browse the repository at this point in the history
Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
  • Loading branch information
vincentkfu committed Sep 20, 2024
1 parent db27281 commit 9e13f02
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 8 deletions.
7 changes: 3 additions & 4 deletions .github/actions/create-guest-image/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

27 changes: 25 additions & 2 deletions .github/actions/start-vm/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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:
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/qemu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 }}

Expand Down

0 comments on commit 9e13f02

Please sign in to comment.