Skip to content

CI

CI #82

Workflow file for this run

on:
# Trigger the workflow on push or
# pull request, but only for the
# main branch.
push:
branches:
- main
pull_request:
branches:
- main
# Weekly run to account for
# changed dependencies.
schedule:
- cron: '17 04 * * 0'
name: CI
jobs:
build:
name: Build and test
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
compiler: ['gcc', 'clang']
fail-fast: false
env:
CC: ${{ matrix.compiler }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Build the code
run: make
- name: Install dependencies
run: sudo apt-get install -yy shelltestrunner
- name: Test creating the release archive
run: make distcheck
coverage:
name: Check code coverage
runs-on: ubuntu-latest
env:
CC: gcc
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install dependencies
run: sudo apt-get install -yy shelltestrunner
- name: Build the code
run: make CFLAGS=-coverage
- name: Run tests under coverage
run: make check
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
name: codecov-gcc
#fail_ci_if_error: true
verbose: true
gcov: true
sanitizers:
name: Test with clang sanitizers
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
compiler: ['clang']
# These are the various sanitizers from https://github.com/google/sanitizers:
cflags:
- '-fsanitize=address -O1 -fno-omit-frame-pointer -g'
- '-fsanitize=memory -fsanitize-memory-track-origins -fPIE -pie -fno-omit-frame-pointer -g -O2'
- '-fsanitize=undefined'
fail-fast: false
env:
CC: ${{ matrix.compiler }}
CFLAGS: ${{ matrix.cflags }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Build the code
run: make
- name: Install dependencies
run: sudo apt-get install -yy shelltestrunner
- name: Run tests
run: make check