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

118 lines
3.5 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']
steps:
- uses: actions/checkout@v2
- uses: ruby/setup-ruby@v1
with:
ruby-version: 3.0
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: dependencies
run: sudo apt-get -y install clang tcc
- name: autogen
run: ./autogen.sh
- name: configure
run: ./configure --enable-tests CC='${{matrix.cc}}' CFLAGS='${{matrix.opt}} -fPIC'
- 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
# 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/
- 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/
mruby:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: dependencies
run: sudo apt-get -y install cppcheck
- working-directory: pkgs/mruby
name: cppcheck
run: cppcheck --quiet --error-exitcode=1 --std=c99 --enable=warning,style,performance,portability .
ruby:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: ruby/setup-ruby@v1
with:
ruby-version: 3.0
- name: dependencies
run: sudo apt-get -y install cppcheck
- name: autogen
run: ./autogen.sh
- name: configure
run: ./configure CFLAGS='-O3 -fPIC'
- name: make
run: make
- name: install
run: sudo make install
- working-directory: pkgs/ruby
name: bundle
run: bundle install
- working-directory: pkgs/ruby
name: compile
run: rake compile
- working-directory: pkgs/ruby
name: test & lint
run: rake
- working-directory: pkgs/ruby
name: cppcheck
run: cppcheck --quiet --error-exitcode=1 --std=c99 --enable=warning,style,performance,portability .
rust:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
components: rustfmt, clippy
- name: autogen
run: ./autogen.sh
- name: configure
run: ./configure CFLAGS='-O3 -fPIC'
- name: make
run: make
- name: install
run: sudo make install
- working-directory: pkgs/rust
name: test
run: cargo test
- working-directory: pkgs/rust
name: fmt
run: cargo fmt --check
- working-directory: pkgs/rust
name: clippy
run: cargo clippy