| 1 |
name: Blivet tests |
| 2 |
|
| 3 |
on: |
| 4 |
pull_request: |
| 5 |
branches: |
| 6 |
- master |
| 7 |
|
| 8 |
jobs: |
| 9 |
build: |
| 10 |
name: blivet-tests |
| 11 |
runs-on: ubuntu-24.04 |
| 12 |
env: |
| 13 |
CI_CONTAINER: libblockdev-ci-blivet-tests |
| 14 |
steps: |
| 15 |
- name: Checkout libblockdev repository |
| 16 |
uses: actions/checkout@v6 |
| 17 |
|
| 18 |
- name: Install podman |
| 19 |
run: | |
| 20 |
sudo apt -qq update |
| 21 |
sudo apt -y -qq install podman |
| 22 |
|
| 23 |
- name: Build the container |
| 24 |
run: | |
| 25 |
podman build --no-cache -t ${{ env.CI_CONTAINER }} -f misc/ci.Dockerfile . |
| 26 |
|
| 27 |
- name: Start the container |
| 28 |
run: | |
| 29 |
podman run -d -t --name ${{ env.CI_CONTAINER }} --privileged --volume "$(pwd):/app" --workdir "/app" ${{ env.CI_CONTAINER }} |
| 30 |
|
| 31 |
- name: Install Blivet test dependencies in the container |
| 32 |
run: | |
| 33 |
podman exec -it ${{ env.CI_CONTAINER }} bash -c "ansible-playbook -i "localhost," -c local /blivet/misc/install-test-dependencies.yml" |
| 34 |
|
| 35 |
- name: Install libblockdev build dependencies in the container |
| 36 |
run: | |
| 37 |
podman exec -it ${{ env.CI_CONTAINER }} bash -c "ansible-playbook -i "localhost," -c local misc/install-test-dependencies.yml -e 'test_dependencies=false'" |
| 38 |
|
| 39 |
- name: Build and install libblockdev in the container |
| 40 |
run: | |
| 41 |
podman exec -it ${{ env.CI_CONTAINER }} bash -c "./autogen.sh && ./configure --prefix=/usr && make -j && make install" |
| 42 |
|
| 43 |
- name: Run Blivet tests in the container |
| 44 |
run: | |
| 45 |
podman exec -it ${{ env.CI_CONTAINER }} bash -c "cd /blivet && make check" |