2022-10-13 19:23:16 +00:00
|
|
|
name: Code Coverage
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- master
|
|
|
|
paths-ignore:
|
|
|
|
- 'docs/**'
|
|
|
|
- '.github/workflows/**'
|
|
|
|
- '!.github/workflows/code_coverage.yml'
|
|
|
|
pull_request:
|
2023-01-25 20:49:47 +00:00
|
|
|
workflow_dispatch:
|
2022-10-13 19:23:16 +00:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
code-coverage:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
container: docker://oraclelinux:8
|
|
|
|
steps:
|
|
|
|
- name: Update Package Manager
|
|
|
|
run: |
|
|
|
|
dnf -y install epel-release
|
|
|
|
dnf -y update
|
|
|
|
dnf install -y 'dnf-command(config-manager)'
|
|
|
|
|
|
|
|
- name: Install Dependencies
|
|
|
|
run: |
|
|
|
|
dnf install -y bison clang flex git llvm make maven cmake zip clang-devel gcc gcc-c++ java-11-openjdk-devel libxml2-devel llvm-devel llvm-static ncurses-devel openmotif openmotif-devel perl perl-Digest-MD5 udunits2 udunits2-devel which zlib-devel python2-devel python3-devel swig diffutils lcov
|
|
|
|
|
|
|
|
- name: Install GTest
|
|
|
|
run: |
|
|
|
|
dnf config-manager --enable ol8_codeready_builder
|
2023-03-20 22:53:01 +00:00
|
|
|
dnf install -y gtest-devel gmock-devel
|
2022-10-13 19:23:16 +00:00
|
|
|
|
|
|
|
- name: Checkout repository
|
|
|
|
uses: actions/checkout@master
|
|
|
|
|
|
|
|
- name: Configure Trick
|
|
|
|
run: |
|
|
|
|
export MAKEFLAGS=-j`nproc`
|
|
|
|
export PYTHON_VERSION=3
|
|
|
|
./configure
|
|
|
|
- name: Build Trick
|
|
|
|
run: |
|
|
|
|
export MAKEFLAGS=-j`nproc`
|
|
|
|
export CFLAGS="-fprofile-arcs -ftest-coverage -O0"
|
|
|
|
export CXXFLAGS="-fprofile-arcs -ftest-coverage -O0"
|
|
|
|
export LDFLAGS="-fprofile-arcs -ftest-coverage -O0"
|
|
|
|
export TRICK_CFLAGS="-fprofile-arcs -ftest-coverage -O0"
|
|
|
|
export TRICK_CXXFLAGS="-fprofile-arcs -ftest-coverage -O0"
|
|
|
|
export TRICK_SYSTEM_LDFLAGS="-fprofile-arcs -ftest-coverage -O0"
|
|
|
|
export TRICK_SYSTEM_CFLAGS="-fprofile-arcs -ftest-coverage -O0"
|
|
|
|
export TRICK_SYSTEM_CXXFLAGS="-fprofile-arcs -ftest-coverage -O0"
|
2023-08-04 16:35:12 +00:00
|
|
|
export JAVA_HOME=$(dirname $(dirname $(readlink -f `which java`)))
|
2022-10-13 19:23:16 +00:00
|
|
|
make
|
|
|
|
- name: Generate Code Coverage
|
|
|
|
run: |
|
|
|
|
export MAKEFLAGS=-j`nproc`
|
|
|
|
export CFLAGS="-fprofile-arcs -ftest-coverage -O0"
|
|
|
|
export CXXFLAGS="-fprofile-arcs -ftest-coverage -O0"
|
|
|
|
export LDFLAGS="-fprofile-arcs -ftest-coverage -O0"
|
|
|
|
export TRICK_CFLAGS="-fprofile-arcs -ftest-coverage -O0"
|
|
|
|
export TRICK_CXXFLAGS="-fprofile-arcs -ftest-coverage -O0"
|
|
|
|
export TRICK_SYSTEM_LDFLAGS="-fprofile-arcs -ftest-coverage -O0"
|
|
|
|
export TRICK_SYSTEM_CFLAGS="-fprofile-arcs -ftest-coverage -O0"
|
|
|
|
export TRICK_SYSTEM_CXXFLAGS="-fprofile-arcs -ftest-coverage -O0"
|
2022-11-17 21:43:29 +00:00
|
|
|
cd share/trick/trickops/
|
|
|
|
python3 -m venv .venv && . .venv/bin/activate && pip3 install -r requirements.txt
|
|
|
|
cd ../../../
|
2022-10-13 19:23:16 +00:00
|
|
|
make code-coverage
|
|
|
|
- name: Upload to Coveralls
|
|
|
|
uses: coverallsapp/github-action@master
|
|
|
|
with:
|
|
|
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
path-to-lcov: "./coverage.info"
|