Skip to content

Commit

Permalink
github: Use shared logic
Browse files Browse the repository at this point in the history
Signed-off-by: Stéphane Graber <[email protected]>
  • Loading branch information
stgraber committed Dec 18, 2024
1 parent ce45d17 commit 124ad8b
Show file tree
Hide file tree
Showing 3 changed files with 81 additions and 81 deletions.
39 changes: 39 additions & 0 deletions .github/actions/build/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Build LXCFS
description: Install dependencies and build the codebase
inputs:
fuse:
required: true
os:
required: true
compiler:
required: true
runs:
using: "composite"
steps:
- name: Install dependencies
shell: bash
run: |
sudo apt-get update -qq
sudo apt-get install -qq ${{ inputs.compiler }}
sudo apt-get install -qq lib${{ inputs.fuse }}-dev
sudo apt-get install -qq python3 python3-pip python3-setuptools pkg-config uuid-runtime
if [ "${{ inputs.os }}" = "ubuntu-22.04" ]; then
sudo pip3 install meson==0.55.1 ninja
else
sudo pip3 install meson==0.55.1 ninja --break-system-packages
fi
- name: Compiler version
shell: bash
env:
CC: ${{ inputs.compiler }}
run: |
${CC} --version
- name: Build
shell: bash
env:
CC: ${{ inputs.compiler }}
run: |
meson setup -Ddocs=false -Dtests=true -Dinit-script=systemd -Dprefix=/usr -Db_sanitize=address,undefined build/
meson compile -C build
25 changes: 25 additions & 0 deletions .github/actions/testsuite/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Test suite
description: Runs the testsuite
inputs:
fuse:
required: true
os:
required: true
compiler:
required: true
runs:
using: "composite"
steps:
- uses: ./.github/actions/build
with:
compiler: ${{ inputs.compiler }}
fuse: ${{ inputs.fuse }}
os: ${{ inputs.os }}

- name: Test
shell: bash
env:
CC: ${{ inputs.compiler }}
run: |
echo 1 | sudo tee /sys/fs/cgroup/cpuset/cgroup.clone_children || true
sudo -E PATH="${PATH}" LD_LIBRARY_PATH="${LD_LIBRARY_PATH}" build/tests/main.sh
98 changes: 17 additions & 81 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,37 +26,11 @@ jobs:
- name: Checkout code
uses: actions/checkout@v2

- name: Install dependencies
run: |
sudo apt-get update -qq
sudo apt-get install -qq ${{ matrix.compiler }}
sudo apt-get install -qq lib${{ matrix.fuse }}-dev
sudo apt-get install -qq python3 python3-pip python3-setuptools pkg-config uuid-runtime
if [ "${{ matrix.os }}" = "ubuntu-22.04" ]; then
sudo pip3 install meson==0.55.1 ninja
else
sudo pip3 install meson==0.55.1 ninja --break-system-packages
fi
- name: Compiler version
env:
CC: ${{ matrix.compiler }}
run: |
${CC} --version
- name: Build
env:
CC: ${{ matrix.compiler }}
run: |
meson setup -Ddocs=false -Dtests=true -Dinit-script=systemd -Dprefix=/usr -Db_sanitize=address,undefined build/
meson compile -C build
- name: Test
env:
CC: ${{ matrix.compiler }}
run: |
echo 1 | sudo tee /sys/fs/cgroup/cpuset/cgroup.clone_children || true
sudo -E PATH="${PATH}" LD_LIBRARY_PATH="${LD_LIBRARY_PATH}" build/tests/main.sh
- uses: ./.github/actions/testsuite
with:
compiler: ${{ matrix.compiler }}
fuse: ${{ matrix.fuse }}
os: ${{ matrix.os }}

testsuite-self-hosted:
name: Test suite (aarch64)
Expand All @@ -83,37 +57,11 @@ jobs:
- name: Checkout code
uses: actions/checkout@v2

- name: Install dependencies
run: |
sudo apt-get update -qq
sudo apt-get install -qq ${{ matrix.compiler }}
sudo apt-get install -qq lib${{ matrix.fuse }}-dev
sudo apt-get install -qq python3 python3-pip python3-setuptools pkg-config uuid-runtime
if [ "${{ matrix.os }}" = "ubuntu-22.04" ]; then
sudo pip3 install meson==0.55.1 ninja
else
sudo pip3 install meson==0.55.1 ninja --break-system-packages
fi
- name: Compiler version
env:
CC: ${{ matrix.compiler }}
run: |
${CC} --version
- name: Build
env:
CC: ${{ matrix.compiler }}
run: |
meson setup -Ddocs=false -Dtests=true -Dinit-script=systemd -Dprefix=/usr -Db_sanitize=address,undefined build/
meson compile -C build
- name: Test
env:
CC: ${{ matrix.compiler }}
run: |
echo 1 | sudo tee /sys/fs/cgroup/cpuset/cgroup.clone_children || true
sudo -E PATH="${PATH}" LD_LIBRARY_PATH="${LD_LIBRARY_PATH}" build/tests/main.sh
- uses: ./.github/actions/testsuite
with:
compiler: ${{ matrix.compiler }}
fuse: ${{ matrix.fuse }}
os: ${{ matrix.os }}

upgrade-test:
name: Upgrade test
Expand All @@ -122,6 +70,8 @@ jobs:
matrix:
compiler:
- gcc
fuse:
- fuse3
os:
- ubuntu-24.04
branch:
Expand All @@ -133,25 +83,11 @@ jobs:
- name: Checkout code
uses: actions/checkout@v2

- name: Install dependencies
run: |
sudo add-apt-repository universe
sudo apt-get update -qq
sudo apt-get install -qq gcc
sudo apt-get install -qq libfuse3-dev
sudo apt-get install -qq python3 python3-pip python3-setuptools pkg-config uuid-runtime
if [ "${{ matrix.os }}" = "ubuntu-22.04" ]; then
sudo pip3 install meson==0.55.1 ninja
else
sudo pip3 install meson==0.55.1 ninja --break-system-packages
fi
- name: Build PR head version
env:
CC: ${{ matrix.compiler }}
run: |
meson setup -Ddocs=false -Dtests=true -Dinit-script=systemd -Dprefix=/usr -Db_sanitize=address,undefined build/
meson compile -C build
- uses: ./.github/actions/build
with:
compiler: ${{ matrix.compiler }}
fuse: ${{ matrix.fuse }}
os: ${{ matrix.os }}

- name: Build upstream head version
env:
Expand Down

0 comments on commit 124ad8b

Please sign in to comment.