Skip to content

pull_request GitHub Action triggered by hramrach πŸš€ #62

pull_request GitHub Action triggered by hramrach πŸš€

pull_request GitHub Action triggered by hramrach πŸš€ #62

Workflow file for this run

name: πŸ₯GitHub Action Debian
run-name: ${{ github.event_name }} GitHub Action triggered by ${{ github.actor }} πŸš€
on: [pull_request]
jobs:
Run-Tests:
runs-on: ubuntu-latest
steps:
- run: echo "πŸŽ‰ The job was automatically triggered by a ${{ github.event_name }} event ${{ github.head_ref }} to ${{ github.base_ref }}."
- run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by GitHub!"
- run: echo "πŸ”Ž The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}."
- name: πŸ“¨ Check out repository code
uses: actions/checkout@v4
with:
path: current
- name: 🏚︎ Check out the base branch
uses: actions/checkout@v4
with:
path: base
ref: ${{ github.base_ref }}
- name: 🌨️ checkout lcov
uses: actions/checkout@v4
with:
path: lcov
ref: v2.0
repository: linux-test-project/lcov
- run: echo "πŸ’‘ The ${{ github.repository }} repository has been cloned to the runner."
- run: echo "πŸ–₯️ The workflow is now ready to test your code on the runner."
- name: 🧰 Install tools
run: |
sudo apt-get update
sudo apt-get install libtest-cmd-perl librrd-dev valgrind sed \
libcapture-tiny-perl libdatetime-perl libdevel-cover-perl libdigest-md5-perl libfile-spec-perl libjson-xs-perl libmodule-load-conditional-perl libscalar-list-utils-perl libtime-hires-perl
- name: πŸ—οΈ Build the stuff
run: |
cd ${{ github.workspace }}/lcov
make PREFIX=${{ github.workspace }}/lcov-install install
for dir in base current ; do
cd ${{ github.workspace }}/$dir
sed -i -e s/[.]ao\\\>/.lo/g lib/test/Module.mk # Need only one kind of object in all binaries for gcov
CFLAGS="-fprofile-arcs -ftest-coverage" LDFLAGS=-lgcov make PROG_EXTRA=sensord BUILD_STATIC_LIB=0
done
- name: 🧫 Run tests
run: |
for dir in base current ; do
cd ${{ github.workspace }}/$dir
${{ github.workspace }}/lcov-install/bin/lcov --capture --initial --branch-coverage --base $(pwd) --no-external --directory . --output-file coverage0.info
make check
done
- name: 🌨️ Calculate coverage
run: |
for dir in base current ; do
cd ${{ github.workspace }}/$dir
${{ github.workspace }}/lcov-install/bin/lcov --capture --branch-coverage --base $(pwd) --no-external --directory . --output-file coverage1.info
${{ github.workspace }}/lcov-install/bin/lcov --branch-coverage --substitute 's#'$dir'/##g' --add-tracefile coverage0.info --add-tracefile coverage1.info --output-file coverage.info
${{ github.workspace }}/lcov-install/bin/lcov --list coverage.info
cp ${{ github.workspace }}/$dir/coverage.info ${{ github.workspace }}/coverage-$dir.info
done
- name: ⬆ Upload coverage
uses: actions/upload-artifact@v4
with:
name: Coverage report
path: ${{ github.workspace }}/current/coverage.info
- name: πŸ”οΈ generate coverage report
uses: romeovs/[email protected]
with:
lcov-file: "${{ github.workspace }}/coverage-current.info"
lcov-base: "${{ github.workspace }}/coverage-base.info"
github-token: "${{ secrets.token }}"
delete-old-comments: true
update-comment: true
- run: echo "🍏 This job's status is ${{ job.status }}."