COMPILER_VERSION="${COMPILER_VERSION}"
CFLAGS=(-O1 -g)
CXXFLAGS=(-O1 -g)
+LDFLAGS=()
if [[ "$COMPILER" == clang ]]; then
CC="clang${COMPILER_VERSION:+-$COMPILER_VERSION}"
--enable-werror
)
+ if [[ "$COVERAGE" == "yes" ]]; then
+ CFLAGS+=(--coverage)
+ CXXFLAGS+=(--coverage)
+ LDFLAGS+=(--coverage)
+ fi
+
if [[ "$SANITIZE" == "yes" ]]; then
opts+=(--enable-asan --enable-ubsan)
CFLAGS+=(-fno-omit-frame-pointer)
sudo -E git clean -xdf
./autogen.sh
- CC="$CC" CXX="$CXX" CFLAGS="${CFLAGS[@]}" CXXFLAGS="${CXXFLAGS[@]}" ./configure "${opts[@]}"
+ CC="$CC" CXX="$CXX" CFLAGS="${CFLAGS[@]}" CXXFLAGS="${CXXFLAGS[@]}" LDFLAGS="${LDFLAGS[@]}" ./configure "${opts[@]}"
;;
MAKE)
make -j
fi
./tests/run.sh --show-diff
+
+ if [[ "$COVERAGE" == "yes" ]]; then
+ lcov --directory . --capture --initial --output-file coverage.info.initial
+ lcov --directory . --capture --output-file coverage.info.run --no-checksum --rc lcov_branch_coverage=1
+ lcov -a coverage.info.initial -a coverage.info.run --rc lcov_branch_coverage=1 -o coverage.info.raw
+ lcov --extract coverage.info.raw "$(pwd)/*" --rc lcov_branch_coverage=1 --output-file coverage.info
+ fi
;;
DISTCHECK)
make distcheck
run: sudo -E .github/workflows/cibuild.sh CHECK
- name: Make install
run: .github/workflows/cibuild.sh INSTALL
+ coveralls:
+ runs-on: ubuntu-latest
+ if: github.repository == 'util-linux/util-linux'
+ env:
+ COMPILER: gcc
+ COMPILER_VERSION: 10
+ SANITIZE: no
+ COVERAGE: yes
+ steps:
+ - name: Repository checkout
+ uses: actions/checkout@v1
+ - name: Ubuntu setup
+ run: sudo -E .github/workflows/cibuild-setup-ubuntu.sh
+ - name: Configure & Make
+ run: .github/workflows/cibuild.sh CONFIGURE MAKE
+ - name: Check
+ run: sudo -E .github/workflows/cibuild.sh CHECK
+ - name: Coveralls
+ uses: coverallsapp/github-action@master
+ with:
+ github-token: ${{ secrets.GITHUB_TOKEN }}
+ path-to-lcov: ./coverage.info
meson:
needs: build
runs-on: ubuntu-latest