60 lines
1.6 KiB
YAML
60 lines
1.6 KiB
YAML
name: Unit Tests
|
|
|
|
on: [push,pull_request]
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
strategy:
|
|
matrix:
|
|
os: [ubuntu-20.04, macos-latest]
|
|
|
|
steps:
|
|
- uses: actions/checkout@v1
|
|
with:
|
|
submodules: recursive
|
|
fetch-depth: 0
|
|
|
|
- name: Discover cores
|
|
if: ${{ matrix.os != 'macos-latest' }}
|
|
run: lscpu | egrep 'Model name|Socket|Thread|NUMA|CPU\(s\)'
|
|
|
|
- name: Generate Configs
|
|
working-directory: ./firmware/
|
|
run: bash gen_config_default.sh
|
|
|
|
- name: Generate Enums
|
|
working-directory: ./firmware/
|
|
run: bash gen_enum_to_string.sh
|
|
|
|
- name: Generate Live Documentation
|
|
working-directory: ./firmware/
|
|
run: bash gen_live_documentation.sh
|
|
|
|
- name: Print Compiler version
|
|
# NOTE: on mac, this is actually symlink'd to clang, not gcc, but that's ok - we want to build on both
|
|
working-directory: .
|
|
run: gcc -v
|
|
|
|
- name: Build Tests
|
|
working-directory: ./unit_tests/
|
|
run: make -j4
|
|
|
|
- name: Run Tests
|
|
working-directory: ./unit_tests/
|
|
run: build/rusefi_test
|
|
|
|
- name: Install Coverage Tools
|
|
if: ${{ matrix.os != 'macos-latest' }}
|
|
run: sudo apt-get install ncftp lcov
|
|
|
|
- name: Generate Code Coverage
|
|
if: ${{ matrix.os != 'macos-latest' }}
|
|
working-directory: ./unit_tests/
|
|
run: ./ci_gcov.sh ${{ secrets.RUSEFI_DOXYGEN_FTP_USER }} ${{ secrets.RUSEFI_DOXYGEN_FTP_PASS }} ${{ secrets.RUSEFI_FTP_SERVER }}
|
|
|
|
- name: Run Tests (sharded)
|
|
working-directory: ./unit_tests/
|
|
run: bash ./run_sharded_tests.sh
|