2021-10-17 17:04:54 -04:00
|
|
|
name: ci
|
|
|
|
on: [push, pull_request]
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
autotools:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Prepare
|
|
|
|
run: |
|
|
|
|
sudo apt update -qq
|
2021-10-18 15:54:15 -04:00
|
|
|
sudo apt install -qq check lcov
|
2021-10-17 17:04:54 -04:00
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Build
|
|
|
|
run: |
|
|
|
|
./autogen.sh
|
|
|
|
./configure --enable-check --enable-debug --enable-gcov
|
|
|
|
make V=1
|
|
|
|
- name: Install
|
|
|
|
run: sudo make install
|
|
|
|
- name: Run tests
|
|
|
|
run: make check
|
2021-10-18 15:54:15 -04:00
|
|
|
- name: Collect coverage
|
|
|
|
run: lcov --capture -d '.' --exclude '/usr*' -o coverage.info
|
2021-10-17 17:04:54 -04:00
|
|
|
- name: Upload coverage
|
|
|
|
if: github.repository == 'c9s/r3'
|
2021-10-18 15:54:15 -04:00
|
|
|
uses: coverallsapp/github-action@1.1.3
|
|
|
|
with:
|
|
|
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
path-to-lcov: coverage.info
|
2021-10-17 17:04:54 -04:00
|
|
|
|
|
|
|
cmake:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Prepare
|
|
|
|
run: |
|
|
|
|
sudo apt update -qq
|
|
|
|
sudo apt install -qq check ninja-build
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Build and test
|
|
|
|
run: |
|
|
|
|
mkdir build && cd build
|
|
|
|
cmake -GNinja ..
|
|
|
|
ninja -v
|
|
|
|
ctest --verbose
|
|
|
|
|
|
|
|
sanitizers:
|
|
|
|
name: ${{ matrix.sanitizer }}-sanitizer [${{ matrix.compiler }}]
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
compiler: [gcc, clang]
|
|
|
|
sanitizer: [thread, undefined, leak, address]
|
|
|
|
steps:
|
|
|
|
- name: Prepare
|
|
|
|
run: |
|
|
|
|
sudo apt update -qq
|
|
|
|
sudo apt install -qq check
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Build
|
|
|
|
env:
|
|
|
|
CC: ${{ matrix.compiler }}
|
|
|
|
run: |
|
|
|
|
mkdir build && cd build
|
|
|
|
CFLAGS="-fsanitize=${{ matrix.sanitizer }} -fno-sanitize-recover=all -fno-omit-frame-pointer" cmake ..
|
|
|
|
VERBOSE=1 make all
|
|
|
|
- name: Test
|
|
|
|
run: |
|
|
|
|
cd build
|
|
|
|
ctest --verbose
|