Skip to content

Improved error message, show Vendor name #1969

Improved error message, show Vendor name

Improved error message, show Vendor name #1969

Workflow file for this run

name: projmgr
on:
workflow_call:
push:
branches:
- main
paths:
- '.github/workflows/projmgr.yml'
- '.github/matrix_includes_projmgr.json'
- 'CMakeLists.txt'
- 'libs/crossplatform/**'
- 'libs/rtefsutils/**'
- 'libs/rtemodel/**'
- 'libs/rteutils/**'
- 'libs/xmlreader/**'
- 'libs/xmltree/**'
- 'libs/xmltreeslim/**'
- 'tools/projmgr/**'
- '!**/docs/**/*'
- '!**/*.md'
pull_request:
paths:
- '.github/workflows/projmgr.yml'
- '.github/matrix_includes_projmgr.json'
- 'CMakeLists.txt'
- 'libs/crossplatform/**'
- 'libs/rtefsutils/**'
- 'libs/rtemodel/**'
- 'libs/rteutils/**'
- 'libs/xmlreader/**'
- 'libs/xmltree/**'
- 'libs/xmltreeslim/**'
- 'tools/projmgr/**'
- '!**/*.md'
release:
types: [published]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
setup:
uses: Open-CMSIS-Pack/devtools/.github/workflows/shared_setup_env.yml@main
with:
run_if: ${{ fromJSON((github.event_name == 'pull_request') || (github.event_name == 'workflow_dispatch') || (github.event_name == 'release' && startsWith(github.ref, 'refs/tags/tools/projmgr/')) || ((github.event.schedule != '') && (!github.event.repository.private))) }}
matrix_prep:
needs: setup
uses: Open-CMSIS-Pack/devtools/.github/workflows/shared_matrix_prep.yml@main
with:
workflow_name: projmgr
build:
needs: [ setup, matrix_prep ]
runs-on: ${{ matrix.runs_on }}
timeout-minutes: 15
strategy:
# fail-fast: true
matrix: ${{ fromJson(needs.matrix_prep.outputs.matrix) }}
steps:
- name: Harden Runner
if: ${{ !github.event.repository.private }}
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
with:
egress-policy: audit
- name: Checkout devtools
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
submodules: true
fetch-depth: 0
# https://github.com/Open-CMSIS-Pack/devtools-build-action
- name: Build
uses: Open-CMSIS-Pack/devtools-build-action@f447c00e0c2a58681faacce9312ead5813f93888 # arm64
with:
target: projmgr
arch: ${{ matrix.arch }}
- name: Archive projmgr
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
with:
name: projmgr-${{ matrix.target }}-${{ matrix.arch }}
path: ./build/tools/projmgr/${{ matrix.target }}-${{ matrix.arch }}/Release/${{ matrix.binary }}
retention-days: ${{ needs.setup.outputs.retention_days }}
if-no-files-found: error
build-swig:
needs: [ setup, matrix_prep ]
runs-on: ${{ matrix.runs_on }}
timeout-minutes: 15
strategy:
# fail-fast: true
matrix: ${{ fromJson(needs.matrix_prep.outputs.matrix) }}
steps:
- name: Harden Runner
if: ${{ !github.event.repository.private }}
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
with:
egress-policy: audit
- name: Checkout devtools
if: matrix.pyswig || matrix.goswig
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
submodules: true
- name: Build swig python libs
if: matrix.pyswig
uses: Open-CMSIS-Pack/devtools-build-action@f447c00e0c2a58681faacce9312ead5813f93888 # arm64
with:
add_cmake_variables: -DSWIG_LIBS=ON
add_cmake_build_args: --config Release
arch: ${{ matrix.arch }}
build_folder: buildswig
target: projmgr-python
- name: Build swig go libs
if: matrix.goswig
uses: Open-CMSIS-Pack/devtools-build-action@f447c00e0c2a58681faacce9312ead5813f93888 # arm64
with:
add_cmake_variables: -DSWIG_LIBS=ON
add_cmake_build_args: --config Release
arch: ${{ matrix.arch }}
build_folder: buildswig
target: projmgr-go
- name: Archive projmgr swig python libs
if: always() && matrix.pyswig
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
with:
name: projmgr-swig-python-${{ matrix.target }}-${{ matrix.arch }}
path: |
./buildswig/tools/projmgr/swig/python/projmgr.py
./buildswig/tools/projmgr/swig/python/_projmgr.pyd
./buildswig/tools/projmgr/swig/python/_projmgr.so
retention-days: ${{ needs.setup.outputs.retention_days }}
- name: Archive projmgr swig go libs
if: always() && matrix.goswig
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
with:
name: projmgr-swig-go-${{ matrix.target }}-${{ matrix.arch }}
path: |
./buildswig/tools/projmgr/swig/go/projmgr.go
./buildswig/tools/projmgr/swig/go/projmgr.so
retention-days: ${{ needs.setup.outputs.retention_days }}
release:
if: |
github.event_name == 'release' &&
startsWith(github.ref, 'refs/tags/tools/projmgr/')
needs: [ build, build-swig, unittest, coverage ]
runs-on: ubuntu-22.04
timeout-minutes: 15
steps:
- name: Checkout devtools
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Create distribution folders
run: |
mkdir -p tools/projmgr/distribution/bin tools/projmgr/distribution/lib tools/projmgr/distribution/doc tools/projmgr/distribution/etc
cp tools/projmgr/docs/LICENSE.txt tools/projmgr/distribution/
cp -r tools/projmgr/docs/Manual/* tools/projmgr/distribution/doc/
cp -r tools/projmgr/schemas/* tools/projmgr/distribution/etc/
cp -r tools/projmgr/templates/* tools/projmgr/distribution/etc/
- name: Download projmgr linux-amd64
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
name: projmgr-linux-amd64
path: tools/projmgr/distribution/bin/linux-amd64/
- name: Download projmgr linux-arm64
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
name: projmgr-linux-arm64
path: tools/projmgr/distribution/bin/linux-arm64/
- name: Download projmgr macos-amd64
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
name: projmgr-darwin-amd64
path: tools/projmgr/distribution/bin/darwin-amd64/
- name: Download projmgr macos-arm64
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
name: projmgr-darwin-arm64
path: tools/projmgr/distribution/bin/darwin-arm64/
- name: Download projmgr windows-amd64
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
name: projmgr-windows-amd64
path: tools/projmgr/distribution/bin/windows-amd64/
- name: Download projmgr windows-arm64
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
name: projmgr-windows-arm64
path: tools/projmgr/distribution/bin/windows-arm64/
- name: Download projmgr-swig-python linux-amd64
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
name: projmgr-swig-python-linux-amd64
path: tools/projmgr/distribution/lib/linux-amd64/python/
- name: Download projmgr-swig-python macos-amd64
if: ${{ !github.event.repository.private }}
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
name: projmgr-swig-python-darwin-amd64
path: tools/projmgr/distribution/lib/darwin-amd64/python/
- name: Download projmgr-swig-python windows-amd64
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
name: projmgr-swig-python-windows-amd64
path: tools/projmgr/distribution/lib/windows-amd64/python/
- name: Download projmgr-swig-go linux-amd64
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
name: projmgr-swig-go-linux-amd64
path: tools/projmgr/distribution/lib/linux-amd64/go/
- name: Download projmgr-swig-go macos-amd64
if: ${{ !github.event.repository.private }}
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
name: projmgr-swig-go-darwin-amd64
path: tools/projmgr/distribution/lib/darwin-amd64/go/
- name: Zip distribution folder
run: zip -r projmgr.zip *
working-directory: tools/projmgr/distribution
- name: Attach zip archive to release assets
uses: svenstaro/upload-release-action@04733e069f2d7f7f0b4aebc4fbdbce8613b03ccd # v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: tools/projmgr/distribution/projmgr.zip
tag: ${{ github.ref }}
overwrite: true
asset_name: projmgr.zip
- name: Download test report windows-amd64
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
name: unit_test_result_projmgr-windows-amd64
path: tools/testreport/windows-amd64/
- name: Download test report linux-amd64
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
name: unit_test_result_projmgr-linux-amd64
path: tools/testreport/linux-amd64/
- name: Download test report macos-amd64
if: ${{ !github.event.repository.private }}
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
name: unit_test_result_projmgr-darwin-amd64
path: tools/testreport/darwin-amd64/
- name: Zip test reports
run: zip -r testreport.zip *
working-directory: tools/testreport
- name: Attach test report archive to release assets
uses: svenstaro/upload-release-action@04733e069f2d7f7f0b4aebc4fbdbce8613b03ccd # v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: tools/testreport/testreport.zip
tag: ${{ github.ref }}
overwrite: true
asset_name: testreport.zip
- name: Download coverage report
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
name: coverage-report-projmgr
path: tools/coverage/
- name: Zip coverage reports
run: zip -r coverage.zip coverage_projmgr
working-directory: tools/coverage
- name: Attach coverage archive to release assets
uses: svenstaro/upload-release-action@04733e069f2d7f7f0b4aebc4fbdbce8613b03ccd # v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: tools/coverage/coverage.zip
tag: ${{ github.ref }}
overwrite: true
asset_name: coverage.zip
unittest:
needs: [ setup, matrix_prep ]
runs-on: ${{ matrix.runs_on }}
timeout-minutes: 15
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.matrix_prep.outputs.matrix) }}
steps:
- name: Harden Runner
if: ${{ !github.event.repository.private }}
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
with:
egress-policy: audit
- name: Checkout devtools
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
submodules: true
# https://github.com/Open-CMSIS-Pack/devtools-build-action
- name: Build ProjMgrUnitTests
uses: Open-CMSIS-Pack/devtools-build-action@f447c00e0c2a58681faacce9312ead5813f93888 # arm64
with:
arch: ${{ matrix.arch }}
build_type: Debug
target: ProjMgrUnitTests
- name: Run projmgr unit tests
if: (matrix.arch != 'arm64')
run: |
ctest -V -C Debug -R ProjMgrUnitTests
working-directory: ./build
- name: Archive unit tests results
if: always() && (matrix.arch != 'arm64')
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
with:
name: unittest-${{ matrix.target }}-${{ matrix.arch }}
path: ./build/Testing/Temporary/LastTest.log
retention-days: ${{ needs.setup.outputs.retention_days }}
if-no-files-found: error
- name: Archive gtest report
if: always() && (matrix.arch != 'arm64')
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
with:
name: unit_test_result_projmgr-${{ matrix.target }}-${{ matrix.arch }}
path: ./build/test_reports/projmgrunittests-*.xml
retention-days: ${{ needs.setup.outputs.retention_days }}
if-no-files-found: error
coverage:
if: |
(github.event_name == 'pull_request') ||
(github.event_name == 'workflow_dispatch') ||
(github.event_name == 'push') ||
(github.event_name == 'release' && startsWith(github.ref, 'refs/tags/tools/projmgr/')) ||
((github.event.schedule != '') && (!github.event.repository.private))
env:
lcov_base: https://github.com/linux-test-project/lcov/releases/download/v1.15/
lcov_installer: lcov-1.15.tar.gz
runs-on: ubuntu-22.04
timeout-minutes: 15
steps:
- name: Harden Runner
if: ${{ !github.event.repository.private }}
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
with:
egress-policy: audit
- name: Install linux deps
run: |
sudo apt-get update
sudo apt-get install \
lcov
- name: Checkout devtools
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
submodules: true
# https://github.com/Open-CMSIS-Pack/devtools-build-action
- name: Build ProjMgrUnitTests
uses: Open-CMSIS-Pack/devtools-build-action@f447c00e0c2a58681faacce9312ead5813f93888 # arm64
with:
add_cmake_variables: -DCOVERAGE=ON
arch: amd64
build_type: Debug
target: ProjMgrUnitTests
- name: Run ProjMgrUnitTests
run: |
ctest -V -C Debug -R ProjMgrUnitTests
working-directory: ./build
- name: Get retention days
id: var
run: |
echo "retention_days=$(echo '${{ (!github.event.repository.private && (github.event_name == 'push' || github.event.schedule != '')) && '7' || '1' }}')" >> $GITHUB_OUTPUT
- name: Archive test report
if: (github.event_name == 'push')
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
with:
name: unit_test_result_projmgr-linux-amd64
path: ./build/test_reports/projmgrunittests-*.xml
retention-days: ${{ steps.var.outputs.retention_days }}
if-no-files-found: error
# Needs to be removed once the bug is resolved
# lcov reporting 1.14 on 1.15 version
# https://groups.google.com/g/linux.debian.bugs.dist/c/a9SZGCENJ2s?pli=1
- name: Setup lcov1.15
run: |
wget -q ${{ env.lcov_base }}/${{ env.lcov_installer }}
tar -xvf ${{ env.lcov_installer }}
working-directory: ./build/tools/projmgr
- name: Generate coverage report
run: |
lcov-1.15/bin/lcov --rc lcov_branch_coverage=1 --rc geninfo_no_exception_branch=1 -c --directory . --output-file full_coverage.info
lcov-1.15/bin/lcov --rc lcov_branch_coverage=1 --rc geninfo_no_exception_branch=1 -e full_coverage.info '/tools/projmgr/include/*' '*/tools/projmgr/src/*' -o coverage_projmgr.info
genhtml coverage_projmgr.info --output-directory coverage_projmgr --branch-coverage
working-directory: ./build/tools/projmgr/
- name: Upload Report to Codecov
if: ${{ !github.event.repository.private }}
uses: Wandalen/wretry.action@8ceaefd717b7cdae4f2637f9a433242ade421a0a # v3.7.2
with:
action: codecov/codecov-action@v4
with: |
files: ./build/tools/projmgr/coverage_projmgr.info
fail_ci_if_error: true
flags: projmgr-cov
token: ${{ secrets.CODECOV_TOKEN }}
verbose: true
attempt_limit: 3
attempt_delay: 5000
- name: Archive coverage report
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
with:
name: coverage-report-projmgr
path: |
./build/tools/projmgr/coverage_projmgr/
./build/tools/projmgr/coverage_projmgr.info
retention-days: ${{ steps.var.outputs.retention_days }}
if-no-files-found: error
test-results-preparation:
name: "Publish Tests Results"
needs: [ unittest ]
runs-on: ubuntu-22.04
steps:
- name: Harden Runner
if: ${{ !github.event.repository.private }}
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
with:
egress-policy: audit
- name: Event File
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
with:
name: Event File projmgr
path: ${{ github.event_path }}