Skip to content

[1.0.2][r] fix name generation when using xi:include #58

[1.0.2][r] fix name generation when using xi:include

[1.0.2][r] fix name generation when using xi:include #58

Workflow file for this run

name: "Unit Tests"
on:
workflow_dispatch:
push:
branches: [ main ]
env:
BUILD_TYPE: Debug
jobs:
check-hsmcpp-version:
if: ${{ (github.repository == 'igor-krechetov/hsmcpp') }}
runs-on: ubuntu-latest
outputs:
commit_version: ${{ steps.get_version.outputs.commit_version }}
steps:
- uses: actions/checkout@v3
- uses: ./.github/workflows/get-commit-version
id: get_version
with:
repo_dir: ${{ env.GITHUB_WORKSPACE }}
commit_sha: ${{ github.event.workflow_run.head_sha }}
run-tests:
needs: check-hsmcpp-version
# only run when started manually or if there is a version change
if: ${{ (needs.check-hsmcpp-version.outputs.commit_version != '') || (github.event_name == 'workflow_dispatch') }}
runs-on: ubuntu-latest
env:
artifacts_dir: "${{github.workspace}}/build_artifacts/"
# For debuging Coveralls
# NODE_COVERALLS_DEBUG: 1
steps:
- uses: awalsh128/[email protected]
with:
packages: lcov
version: 1.0
# checkout repositories
- uses: actions/checkout@v3
with:
submodules: 'recursive'
ref: ${{ github.ref }}
# build tests
- name: Build tests
uses: ./.github/workflows/build_helper
with:
src_dir: ${{github.workspace}}
build_dir: ${{github.workspace}}/build
platform: 'posix'
build_examples: 'OFF'
codecoverage: 'ON'
- name: Run Tests (STD)
run: |
cd ${{github.workspace}}/build/
timeout 2m ./tests/hsmUnitTestsSTD > ./tests_result_std.log
lcov -c -d . -o ./coverage_std.info
- name: Run Tests (GLib)
run: |
cd ${{github.workspace}}/build/
timeout 2m ./tests/hsmUnitTestsGLib > ./tests_result_glib.log
lcov -c -d . -o ./coverage_glib.info
- name: Run Tests (GLibmm)
run: |
cd ${{github.workspace}}/build/
timeout 2m ./tests/hsmUnitTestsGLibmm > ./tests_result_glibmm.log
lcov -c -d . -o ./coverage_glibmm.info
- name: Run Tests (Qt)
run: |
cd ${{github.workspace}}/build/
timeout 2m ./tests/hsmUnitTestsQt > ./tests_result_qt.log
lcov -c -d . -o ./coverage_qt.info
- name: Generate Coverage
run: |
cd ${{github.workspace}}/build/
lcov --add-tracefile ./coverage_std.info \
-a ./coverage_glib.info \
-a ./coverage_qt.info \
-a ./coverage_glibmm.info \
-o ./coverage.info
lcov -r ./coverage.info /usr/include/\* . -o ./coverage.info
lcov -r ./coverage.info \*/build/\* . -o ./coverage.info
lcov -r ./coverage.info \*/tests/\* . -o ./coverage.info
lcov -r ./coverage.info \*/gcc_64/include/QtCore/\* . -o ./coverage.info
lcov -r ./coverage.info \*/thirdparty/\* . -o ./coverage.info
- name: Push test coverage to Coveralls
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: ${{github.workspace}}/build/coverage.info
# checkout artifacts branch
- uses: actions/checkout@v3
with:
ref: build_artifacts
path: './build_artifacts'
# prepare GPG
- name: Import GPG key
uses: crazy-max/ghaction-import-gpg@v5
with:
gpg_private_key: ${{ secrets.BOT_GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.BOT_GPG_PASSPHRASE }}
git_config_global: true
git_user_signingkey: true
git_commit_gpgsign: true
workdir: './build_artifacts'
# Upload test artifacts
- name: Copy test results to artifacts folder
run: |
cp ${{github.workspace}}/build/tests_result_* ${{ env.artifacts_dir }}
- name: Push test artifacts to branch
run: |
cd ${{ env.artifacts_dir }}
git add -A ./
git commit -S -am "[auto] build artifacts for commit ${{ github.sha }}"
git push