Skip to content

Commit 990bece

Browse files
authored
Merge pull request #86 from libvmi/test_ci
Test CI
2 parents 290ab42 + ce9caa7 commit 990bece

2 files changed

Lines changed: 68 additions & 34 deletions

File tree

Lines changed: 60 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,65 @@
1-
name: 'Libvmi setup'
2-
description: 'This actions installs LibVMI on the system'
3-
author: 'Mathieu Tarral'
1+
name: "Libvmi setup"
2+
description: "This actions installs LibVMI on the system"
3+
author: "Mathieu Tarral"
44
runs:
5-
using: 'composite'
6-
steps:
7-
- name: Ensure sudo is available (manylinux container compat)
8-
shell: bash
9-
run: |
10-
if [ "$EUID" -eq 0 ]; then
11-
apt-get update && apt-get install -y sudo
12-
fi
5+
using: "composite"
6+
steps:
7+
- name: Detect OS and Set Environment Variable
8+
id: detect-os
9+
shell: bash
10+
run: |
11+
. /etc/os-release
12+
if [ "$ID" = "ubuntu" ]; then
13+
echo "OS_TYPE=Ubuntu" >> $GITHUB_ENV
14+
elif [ "$ID" = "almalinux" ]; then
15+
echo "OS_TYPE=CentOS" >> $GITHUB_ENV
16+
else
17+
echo "Unsupported OS: $ID"
18+
exit 1
19+
fi
1320
14-
- name: install dependencies
15-
shell: bash
16-
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
21+
- name: install dependencies
22+
shell: bash
23+
run: |
24+
if [ "${{ env.OS_TYPE }}" = "Ubuntu" ]; then
25+
sudo apt-get update && sudo apt-get install -qq cmake flex bison libglib2.0-dev libvirt-dev libjson-c-dev libyajl-dev
26+
elif [ "${{ env.OS_TYPE }}" = "CentOS" ]; then
27+
yum update && yum install -y cmake flex bison glib2-devel libvirt-devel json-c-devel yajl-devel
28+
else
29+
echo "Unknown OS"
30+
fi
1731
18-
- name: clone libvmi
19-
uses: actions/checkout@v2
20-
with:
21-
repository: libvmi/libvmi
22-
path: libvmi
23-
# pinned to a specific commit to avoid breakage
24-
ref: '45b32c0f0003b4037700a1b534879b7d8bee5de0'
32+
- name: install Xen headers for CentOS
33+
shell: bash
34+
run: |
35+
if [ "${{ env.OS_TYPE }}" = "CentOS" ]; then
36+
yum groupinstall -y "Development Tools"
37+
yum install -y python3-devel iasl libuuid-devel ncurses-devel pixman-devel yajl-devel ninja-build
38+
git clone --depth 1 https://github.com/xen-project/xen.git -b RELEASE-4.18.0
39+
cd xen
40+
./configure --disable-docs --disable-stubdom
41+
make -j $(nproc)
42+
make install
43+
fi
2544
26-
- name: install libvmi
27-
shell: bash
28-
run: |
29-
cmake -B build -DCMAKE_INSTALL_PREFIX=/usr .
30-
cmake --build build
45+
- name: clone libvmi
46+
uses: actions/checkout@v2
47+
with:
48+
repository: libvmi/libvmi
49+
path: libvmi
50+
# pinned to a specific commit to avoid breakage
51+
ref: "e7074407fc3b98db1aa73f918b3720bd4438734b"
52+
53+
- name: install libvmi
54+
shell: bash
55+
run: |
56+
cmake -B build -DCMAKE_INSTALL_PREFIX=/usr .
57+
cmake --build build
58+
if [ "${{ env.OS_TYPE }}" = "Ubuntu" ]; then
3159
sudo cmake --build build --target install
32-
working-directory: libvmi
60+
elif [ "${{ env.OS_TYPE }}" = "CentOS" ] || [ "${{ env.OS_TYPE }}" = "Debian" ]; then
61+
cmake --build build --target install
62+
else
63+
echo "Unknown OS"
64+
fi
65+
working-directory: libvmi

.github/workflows/ci.yml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ jobs:
1313
lint:
1414
runs-on: ubuntu-latest
1515
steps:
16-
- uses: actions/checkout@v2
16+
- uses: actions/checkout@v4
1717

1818
- name: Set up Python 3.7 🐍
19-
uses: actions/setup-python@v1
19+
uses: actions/setup-python@v4
2020
with:
2121
python-version: '3.7'
2222

@@ -30,18 +30,18 @@ jobs:
3030
runs-on: ubuntu-latest
3131
strategy:
3232
matrix:
33-
python: ['3.6', '3.7', '3.8', '3.9']
33+
python: ['3.7', '3.8', '3.9', '3.10', '3.11']
3434

3535
steps:
36-
- uses: actions/checkout@v2
36+
- uses: actions/checkout@v4
3737
with:
3838
path: python-libvmi
3939

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

4343
- name: Set up Python 🐍
44-
uses: actions/setup-python@v1
44+
uses: actions/setup-python@v4
4545
with:
4646
python-version: ${{ matrix.python }}
4747

@@ -70,10 +70,10 @@ jobs:
7070
publish:
7171
runs-on: ubuntu-latest
7272
needs: [build]
73-
container: quay.io/pypa/manylinux_2_24_x86_64
73+
container: quay.io/pypa/manylinux_2_28_x86_64
7474
strategy:
7575
matrix:
76-
python: ['3.6', '3.7', '3.8', '3.9']
76+
python: ['3.7', '3.8', '3.9', '3.10', '3.11']
7777

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

0 commit comments

Comments
 (0)