1
0
Fork 0
mirror of https://github.com/tailix/libkernaux.git synced 2024-10-30 11:54:01 -04:00
libkernaux/.github/workflows/main.yml

87 lines
2.7 KiB
YAML

name: Main
on:
push:
branches: [master]
pull_request:
branches: [master]
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
cc: ['gcc', 'clang', 'tcc']
opt: ['', '-O0', '-O3']
steps:
- uses: actions/checkout@v2
- name: dependencies
run: sudo apt-get --yes install clang tcc
- name: autogen
run: ./autogen.sh
- name: configure
run: ./configure --enable-tests --enable-tests-python CC='${{matrix.cc}}' CFLAGS='${{matrix.opt}}'
- name: make
run: make
- name: check
run: make check || (./test-suite-log && false)
- name: install
run: sudo make install
cond:
runs-on: ubuntu-latest
strategy:
matrix:
pkg:
- main: 'all'
- main: 'file'
- main: 'ntoa'
other: '--without-printf --without-units'
- main: 'printf'
steps:
- uses: actions/checkout@v2
- name: autogen
run: ./autogen.sh
- name: configure
run: ./configure --without-${{matrix.pkg.main}} ${{matrix.pkg.other}} --enable-tests --enable-tests-python
- name: make
run: make
- name: check
run: make check || (./test-suite-log && false)
- name: install
run: sudo make install
dist:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: autogen
run: ./autogen.sh
- name: configure dist
run: ./configure
- name: dist
run: make dist
- name: extract
run: tar -xzf "libkernaux-$(cat VERSION).tar.gz"
- name: configure
run: cd "libkernaux-$(cat VERSION)" && ./configure --enable-tests --enable-tests-python
- name: make
run: cd "libkernaux-$(cat VERSION)" && make
- name: check
run: cd "libkernaux-$(cat VERSION)" && make check || (./test-suite-log && false)
- name: install
run: cd "libkernaux-$(cat VERSION)" && sudo make install
cppcheck:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: dependencies
run: sudo apt-get --yes install cppcheck
- name: cppcheck source code
# TODO: don't suppress "src/printf.c"
run: cppcheck --quiet --error-exitcode=1 --std=c99 --enable=warning,style,performance,portability --suppress='*:src/printf.c' include/ src/ libc/
- 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/