libkernaux/.github/workflows/test.yml

50 lines
1.6 KiB
YAML
Raw Normal View History

2021-12-13 22:24:25 +00:00
name: Test
on:
push:
2021-12-13 22:33:53 +00:00
branches: [master]
2021-12-13 22:24:25 +00:00
pull_request:
2021-12-13 22:33:53 +00:00
branches: [master]
2021-12-13 22:24:25 +00:00
jobs:
2021-12-14 22:20:48 +00:00
test:
2021-12-14 19:35:34 +00:00
runs-on: ubuntu-latest
2021-12-14 22:20:48 +00:00
strategy:
matrix:
2021-12-14 23:03:51 +00:00
cc: ['gcc', 'clang', 'tcc']
2021-12-14 22:20:48 +00:00
opt: ['', '-O0', '-O3']
2021-12-15 10:45:40 +00:00
assert: ['--enable-assert', '--disable-assert']
2021-12-15 14:28:29 +00:00
null_guard: ['--enable-null-guard', '--disable-null-guard']
2021-12-14 22:20:48 +00:00
werror:
- cflag: '-Werror'
mb2: '--without-multiboot2'
2021-12-14 22:20:48 +00:00
- cflag: ''
mb2: '--with-multiboot2'
2021-12-14 19:35:34 +00:00
steps:
- uses: actions/checkout@v2
2021-12-14 23:03:51 +00:00
- name: dependencies
2021-12-17 20:26:29 +00:00
run: sudo apt install clang tcc
2021-12-14 19:35:34 +00:00
- name: autogen
run: ./autogen.sh
2021-12-14 19:36:53 +00:00
- name: configure
2021-12-19 04:27:13 +00:00
run: ./configure ${{matrix.assert}} ${{matrix.null_guard}} ${{matrix.werror.mb2}} CC='${{matrix.cc}}' CFLAGS='${{matrix.opt}} ${{matrix.werror.cflag}}'
2021-12-14 22:10:28 +00:00
- name: make
run: make
- name: check
2021-12-15 10:45:40 +00:00
run: make check || cat test-suite.log
2021-12-17 20:26:29 +00:00
- name: install
run: sudo make install
cppcheck:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: dependencies
run: sudo apt install cppcheck
2021-12-17 20:17:14 +00:00
- 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/