Skip to content

Testing push to refs/heads/feat-coverage by @asimos-bot #75

Testing push to refs/heads/feat-coverage by @asimos-bot

Testing push to refs/heads/feat-coverage by @asimos-bot #75

Workflow file for this run

# This starter workflow is for a CMake project running on a single platform. There is a different starter workflow if you need cross-platform coverage.
# See: https://github.com/actions/starter-workflows/blob/main/ci/cmake-multi-platform.yml
name: Linux
run-name: Testing push to ${{ github.ref }} by @${{ github.actor }}
on: [push]
env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: Coverage
jobs:
build:
# The CMake configure and build commands are platform agnostic and should work equally well on Windows or Mac.
# You can convert this to a matrix build if you need cross-platform coverage.
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: Configure CMake
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
- name: Build
# Build your program with the given configuration
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
- name: Test
working-directory: ${{github.workspace}}/build
run: ./test
- name: get coverage for badge
working-directory: ${{github.workspace}}/build
run: |
echo "env:"
cat $GITHUB_ENV
echo "COVERAGE=$(make coverage | head -n 1)" >> $GITHUB_ENV
echo "env:"
cat $GITHUB_ENV
# var REF = 'refs/pull/27/merge.json';
REF=${{ github.ref }}
# console.log('github.ref: ' + REF);
echo "github.ref: $REF"
# var PATHS = REF.split('/');
IFS='/' read -ra PATHS <<< "$REF"
# var BRANCH_NAME = PATHS[1] + '_' + PATHS[2];
BRANCH_NAME="${PATHS[1]}_${PATHS[2]}"
# console.log(BRANCH_NAME); // 'pull_27' or 'heads_main'
echo "branch name: $BRANCH_NAME"
# process.env.BRANCH = 'pull_27';
echo "BRANCH=${BRANCH_NAME}" >> $GITHUB_ENV
echo "env:"
cat $GITHUB_ENV
- name: create coverage badge
uses: schneegans/dynamic-badges-action@v1.7.0
with:
auth: ${{ secrets.GIST_SECRET }}
gistID: 1062ce0f390bb2b6458d29f225cc08b5
filename: minhttp__${{ env.BRANCH }}_coverage.json
label: Test Coverage
message: ${{ env.COVERAGE }}
color: green