Skip to content

Commit

Permalink
Merge pull request #86 from libvmi/test_ci
Browse files Browse the repository at this point in the history
Test CI
  • Loading branch information
Wenzel authored Dec 5, 2023
2 parents 290ab42 + ce9caa7 commit 990bece
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 34 deletions.
87 changes: 60 additions & 27 deletions .github/actions/libvmi-setup/action.yml
Original file line number Diff line number Diff line change
@@ -1,32 +1,65 @@
name: 'Libvmi setup'
description: 'This actions installs LibVMI on the system'
author: 'Mathieu Tarral'
name: "Libvmi setup"
description: "This actions installs LibVMI on the system"
author: "Mathieu Tarral"
runs:
using: 'composite'
steps:
- name: Ensure sudo is available (manylinux container compat)
shell: bash
run: |
if [ "$EUID" -eq 0 ]; then
apt-get update && apt-get install -y sudo
fi
using: "composite"
steps:
- name: Detect OS and Set Environment Variable
id: detect-os
shell: bash
run: |
. /etc/os-release
if [ "$ID" = "ubuntu" ]; then
echo "OS_TYPE=Ubuntu" >> $GITHUB_ENV
elif [ "$ID" = "almalinux" ]; then
echo "OS_TYPE=CentOS" >> $GITHUB_ENV
else
echo "Unsupported OS: $ID"
exit 1
fi
- name: install dependencies
shell: bash
run: sudo apt-get update && sudo apt-get install -qq cmake bison flex check libjson-c-dev libglib2.0-dev libxenstore3.0 libxen-dev libvirt-dev
- name: install dependencies
shell: bash
run: |
if [ "${{ env.OS_TYPE }}" = "Ubuntu" ]; then
sudo apt-get update && sudo apt-get install -qq cmake flex bison libglib2.0-dev libvirt-dev libjson-c-dev libyajl-dev
elif [ "${{ env.OS_TYPE }}" = "CentOS" ]; then
yum update && yum install -y cmake flex bison glib2-devel libvirt-devel json-c-devel yajl-devel
else
echo "Unknown OS"
fi
- name: clone libvmi
uses: actions/checkout@v2
with:
repository: libvmi/libvmi
path: libvmi
# pinned to a specific commit to avoid breakage
ref: '45b32c0f0003b4037700a1b534879b7d8bee5de0'
- name: install Xen headers for CentOS
shell: bash
run: |
if [ "${{ env.OS_TYPE }}" = "CentOS" ]; then
yum groupinstall -y "Development Tools"
yum install -y python3-devel iasl libuuid-devel ncurses-devel pixman-devel yajl-devel ninja-build
git clone --depth 1 https://github.com/xen-project/xen.git -b RELEASE-4.18.0
cd xen
./configure --disable-docs --disable-stubdom
make -j $(nproc)
make install
fi
- name: install libvmi
shell: bash
run: |
cmake -B build -DCMAKE_INSTALL_PREFIX=/usr .
cmake --build build
- name: clone libvmi
uses: actions/checkout@v2
with:
repository: libvmi/libvmi
path: libvmi
# pinned to a specific commit to avoid breakage
ref: "e7074407fc3b98db1aa73f918b3720bd4438734b"

- name: install libvmi
shell: bash
run: |
cmake -B build -DCMAKE_INSTALL_PREFIX=/usr .
cmake --build build
if [ "${{ env.OS_TYPE }}" = "Ubuntu" ]; then
sudo cmake --build build --target install
working-directory: libvmi
elif [ "${{ env.OS_TYPE }}" = "CentOS" ] || [ "${{ env.OS_TYPE }}" = "Debian" ]; then
cmake --build build --target install
else
echo "Unknown OS"
fi
working-directory: libvmi
15 changes: 8 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Set up Python 3.7 🐍
uses: actions/setup-python@v1
uses: actions/setup-python@v4
with:
python-version: '3.7'

Expand All @@ -30,18 +30,18 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python: ['3.6', '3.7', '3.8', '3.9']
python: ['3.7', '3.8', '3.9', '3.10', '3.11']

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
path: python-libvmi

- name: Install Libvmi
uses: ./python-libvmi/.github/actions/libvmi-setup

- name: Set up Python 🐍
uses: actions/setup-python@v1
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}

Expand Down Expand Up @@ -70,10 +70,10 @@ jobs:
publish:
runs-on: ubuntu-latest
needs: [build]
container: quay.io/pypa/manylinux_2_24_x86_64
container: quay.io/pypa/manylinux_2_28_x86_64
strategy:
matrix:
python: ['3.6', '3.7', '3.8', '3.9']
python: ['3.7', '3.8', '3.9', '3.10', '3.11']

steps:
- uses: actions/checkout@v2
Expand Down Expand Up @@ -101,3 +101,4 @@ jobs:
user: __token__
password: ${{ secrets.ACCESS_TOKEN }}
packages_dir: manylinux
if: startsWith(github.ref, 'refs/tags/v')

0 comments on commit 990bece

Please sign in to comment.