Skip to content

Commit

Permalink
GitHub workflows (basic): remove Ubuntu 18.04, add 22.04
Browse files Browse the repository at this point in the history
GitHub has ended Ubuntu 18.04 (bionic) support in 12/22.
Remove the 18.04 runner, and use Ubuntu 22.04 (jammy) instead. While at it,
use a matrix for the build. This way we get gcc-9 and clang-10 on
20.04, and gcc-11 and clang-14 on 22.04.

Jammy-related cludges for the workflow:

 - We need to install linux-modules-extra to be able to use the zram device.
 - valgrind doesn't support the dwarf-5 format that clang-14 generate
   by default. See e.g. https://bugs.kde.org/show_bug.cgi?id=452758
  • Loading branch information
mwilck committed Sep 20, 2023
1 parent 308c007 commit 9acb1cb
Showing 1 changed file with 49 additions and 46 deletions.
95 changes: 49 additions & 46 deletions .github/workflows/build-and-unittest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,24 @@ on:
pull_request:

jobs:
bionic:
runs-on: ubuntu-18.04
jammy:
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
rl: ['', 'libreadline', 'libedit']
cc: [ gcc, clang ]
steps:
- uses: actions/checkout@v2
- name: update
run: sudo apt-get update
- name: dependencies
run: >
sudo apt-get install --yes gcc
make pkg-config valgrind
libdevmapper-dev libreadline-dev libaio-dev libsystemd-dev
libudev-dev libjson-c-dev liburcu-dev libcmocka-dev libedit-dev
libmount-dev linux-modules-extra-$(uname -r)
- name: mpath
run: sudo modprobe dm_multipath
- name: zram
Expand All @@ -23,28 +37,42 @@ jobs:
run: echo ZRAM=$(sudo cat /sys/class/zram-control/hot_add) >> $GITHUB_ENV
- name: set-zram-size
run: echo 1G | sudo tee /sys/block/zram$ZRAM/disksize
- name: update
run: sudo apt-get update
- name: dependencies
run: >
sudo apt-get install --yes gcc
make perl-base pkg-config valgrind
libdevmapper-dev libreadline-dev libaio-dev libsystemd-dev
libudev-dev libjson-c-dev liburcu-dev libcmocka-dev libedit-dev libmount-dev
- name: set CC
run: echo CC=${{ matrix.cc }} >> $GITHUB_ENV
- name: set optflags
# valgrind doesn't support the dwarf-5 format of clang 14
run: echo OPT='-O2 -gdwarf-4 -fstack-protector-strong' >> $GITHUB_ENV
if: ${{ matrix.cc == 'clang' }}
- name: build
run: make -Orecurse -j$(grep -c ^processor /proc/cpuinfo)
run: >
make -Orecurse -j$(grep -c ^processor /proc/cpuinfo)
READLINE=${{ matrix.rl }} OPTFLAGS="$OPT"
- name: test
run: make -Orecurse -j$(grep -c ^processor /proc/cpuinfo) test
run: >
make -Orecurse -j$(grep -c ^processor /proc/cpuinfo)
OPTFLAGS="$OPT" test
- name: valgrind-test
run: make -Orecurse -j$(grep -c ^processor /proc/cpuinfo) valgrind-test
id: valgrind
run: >
make -Orecurse -j$(grep -c ^processor /proc/cpuinfo)
OPTFLAGS="$OPT" valgrind-test
continue-on-error: true
- name: valgrind-results
run: cat tests/*.vgr
- name: fail if valgrind failed
run: /bin/false
if: steps.valgrind.outcome != 'success'
- name: clean-nonroot-artifacts
run: rm -f tests/dmevents.out tests/directio.out
- name: root-test
run: sudo make DIO_TEST_DEV=/dev/zram$ZRAM test
focal-gcc10:
focal:
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
rl: ['', 'libreadline', 'libedit']
cc: [ gcc, clang ]
steps:
- uses: actions/checkout@v2
- name: mpath
Expand All @@ -56,49 +84,24 @@ jobs:
- name: dependencies
run: >
sudo apt-get install --yes gcc-10
make perl-base pkg-config valgrind
libdevmapper-dev libreadline-dev libaio-dev libsystemd-dev
libudev-dev libjson-c-dev liburcu-dev libcmocka-dev libedit-dev
- name: set CC
run: echo CC=gcc-10 >> $GITHUB_ENV
- name: build
run: make -Orecurse -j$(grep -c ^processor /proc/cpuinfo)
- name: test
run: make -Orecurse -j$(grep -c ^processor /proc/cpuinfo) test
- name: valgrind-test
run: make -Orecurse -j$(grep -c ^processor /proc/cpuinfo) valgrind-test
- name: valgrind-results
run: cat tests/*.vgr
- name: clean-nonroot-artifacts
run: rm -f tests/dmevents.out tests/directio.out
- name: root-test
run: sudo make DIO_TEST_DEV=/dev/ram0 test
focal-clang10:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: mpath
run: sudo modprobe dm_multipath
- name: brd
run: sudo modprobe brd rd_nr=1 rd_size=65536
- name: update
run: sudo apt-get update
- name: dependencies
run: >
sudo apt-get install --yes clang
make perl-base pkg-config valgrind
make pkg-config valgrind
libdevmapper-dev libreadline-dev libaio-dev libsystemd-dev
libudev-dev libjson-c-dev liburcu-dev libcmocka-dev libedit-dev
- name: set CC
run: echo CC=clang >> $GITHUB_ENV
run: echo CC=${{ matrix.cc }} >> $GITHUB_ENV
- name: build
run: make -Orecurse -j$(grep -c ^processor /proc/cpuinfo)
- name: test
run: make -Orecurse -j$(grep -c ^processor /proc/cpuinfo) test
- name: valgrind-test
id: valgrind
run: make -Orecurse -j$(grep -c ^processor /proc/cpuinfo) valgrind-test
continue-on-error: true
- name: valgrind-results
run: cat tests/*.vgr
- name: fail if valgrind failed
run: /bin/false
if: steps.valgrind.outcome != 'success'
- name: clean-nonroot-artifacts
run: rm -f tests/dmevents.out tests/directio.out
- name: root-test
Expand Down

0 comments on commit 9acb1cb

Please sign in to comment.