build: Update cmake command in ci.yml for better build process #196
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build | |
on: | |
push: | |
paths: | |
- 'srcs/**' | |
- 'tests/**' | |
- 'CMakeLists.txt' | |
- 'e2e_tests/**' | |
- '.github/workflows/ci.yml' | |
jobs: | |
linux: | |
runs-on: "${{ matrix.os }}" | |
strategy: | |
matrix: | |
os: [ubuntu-22.04] | |
env: | |
AFL_SKIP_CPUFREQ: 1 | |
AFL_I_DONT_CARE_ABOUT_MISSING_CRASHES: 1 | |
CC: gcc | |
CXX: g++ | |
POLYGLOT_ROOT: ${{ github.workspace }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: install packages | |
run: sudo apt-get install -y build-essential clang llvm-dev libc++-dev python3-dev python3-setuptools cmake git python3-pip lcov ninja-build | |
- name: pull submodule | |
run: git submodule update --init | |
- name: install conan | |
run: pip3 install conan fire | |
- name: install conan profile | |
run: conan profile detect | |
- name: build | |
run: cmake -Bbuild -DCMAKE_BUILD_TYPE=Debug -DGRAMMAR_FILE=$POLYGLOT_ROOT/grammars/simplelang/SimpleLang.g4 -DCODE_COVERAGE=ON && ninja -C build | |
- name: unittest | |
run: cd build && ctest --repeat until-fail:3 | |
- name: benchmark | |
run: cd build/benchmarks && ./mutation_bench --benchmark_format=json | tee benchmark_result.json | |
- name: Store benchmark result | |
uses: benchmark-action/github-action-benchmark@v1 | |
with: | |
tool: 'googlecpp' | |
output-file-path: build/benchmarks/benchmark_result.json | |
external-data-json-path: ./benchmarks/benchmark-data.json | |
comment-on-alert: true | |
fail-on-alert: true | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
summary-always: true | |
- name: Generate Coverage Report | |
run: cd build && lcov --directory . --capture --output-file coverage.info && lcov --remove coverage.info '/usr/*' --output-file coverage.info && lcov --remove coverage.info '/*/experiments/generated/*' --output-file coverage.info && lcov --remove coverage.info '/*/.conan2/*' --output-file coverage.info && lcov --list coverage.info | |
- name: Upload coverage reports to Codecov | |
uses: codecov/codecov-action@v3 | |
with: | |
files: build/coverage.info |