Skip to content

Commit

Permalink
GitHub workflows: native.yml: allow running CI tests requiring root
Browse files Browse the repository at this point in the history
Signed-off-by: Martin Wilck <[email protected]>
  • Loading branch information
mwilck committed Jul 10, 2024
1 parent bb48f4c commit 9881798
Showing 1 changed file with 50 additions and 2 deletions.
52 changes: 50 additions & 2 deletions .github/workflows/native.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,24 @@ jobs:
uses: actions/checkout@v1
- name: build and test
if: ${{ matrix.os != 'jessie' }}
run: make test
run: make -j -Orecurse test
- name: build and test (jessie)
# On jessie, we use libreadline 5 (no licensing issue)
if: ${{ matrix.os == 'jessie' }}
run: make -j -Orecurse READLINE=libreadline test
run: make -j -Orecurse READLINE=libreadline test
- name: create binary archive
run: >
tar cfv binaries.tar
Makefile* config.mk
libmpathcmd/*.so* libmultipath/*.so* libmpathutil/*.so*
libmultipath/checkers/*.so libmultipath/prioritizers/*.so
libmultipath/foreign/*.so
tests/lib tests/*-test tests/Makefile tests/*.so*
- name: upload binary archive
uses: actions/upload-artifact@v1
with:
name: native-${{ matrix.os }}
path: binaries.tar
- name: clean
run: make clean
- name: clang
Expand All @@ -58,3 +71,38 @@ jobs:
env:
CC: clang
run: make READLINE=libreadline test

root-test:
runs-on: ubuntu-22.04
needs: stable
strategy:
fail-fast: false
matrix:
os:
- debian-jessie
- debian-buster
- debian-bullseye
- debian-bookworm
- fedora-40
- opensuse-leap
steps:
- name: mpath
run: sudo modprobe dm_multipath
- name: brd
run: sudo modprobe brd rd_nr=1 rd_size=65536
- name: download binary archive
uses: actions/download-artifact@v1
with:
name: native-${{ matrix.os }}
- name: unpack binary archive
run: tar xfv native-${{ matrix.os }}/binaries.tar
- name: run root tests
uses: mosteo-actions/docker-run@v1
with:
image: ghcr.io/mwilck/multipath-run-debian-${{ matrix.os }}
guest-dir: /build
host-dir: ${{ github.workspace }}
params: --privileged -v /dev/ram0:/dev/ram0
command: -C tests DIO_TEST_DEV=/dev/ram0
- name: show root test output
run: cat tests/directio.out tests/dmevents.out

0 comments on commit 9881798

Please sign in to comment.