|
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" |
4 | 4 | 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 |
13 | 20 |
|
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 |
17 | 31 |
|
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 |
25 | 44 |
|
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 |
31 | 59 | 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 |
0 commit comments