1
0
Fork 0
mirror of https://github.com/tailix/libkernaux.git synced 2024-11-13 11:04:27 -05:00
libkernaux/.github/workflows/test.yml

46 lines
1.6 KiB
YAML

name: Test
on:
push:
branches: [master]
pull_request:
branches: [master]
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
# TODO: something is wrong with TCC, Multiboot 2 info tag struct size
#cc: ['gcc', 'clang', 'tcc']
cc: ['gcc', 'clang']
opt: ['', '-O0', '-O3']
assert: ['--enable-assert', '--disable-assert']
guard: ['--enable-guard', '--disable-guard']
steps:
- uses: actions/checkout@v2
- name: dependencies
run: sudo apt-get -y install clang tcc
- name: autogen
run: ./autogen.sh
- name: configure
run: ./configure --enable-tests ${{matrix.assert}} ${{matrix.guard}} CC='${{matrix.cc}}' CFLAGS='${{matrix.opt}}'
- name: make
run: make
- name: check
run: make check || (cat test-suite.log && false)
- name: install
run: sudo make install
cppcheck:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: dependencies
run: sudo apt-get -y install cppcheck
- name: cppcheck source code
run: cppcheck --quiet --error-exitcode=1 --std=c99 --enable=warning,style,performance,portability include/ src/
- name: cppcheck examples
run: cppcheck --quiet --error-exitcode=1 --std=c99 --enable=warning,style,performance,portability --suppress=duplicateExpression --suppress=staticStringCompare examples/
- name: cppcheck tests
run: cppcheck --quiet --error-exitcode=1 --std=c99 --enable=warning,style,performance,portability --suppress=unusedStructMember tests/