diff --git a/.github/scripts/check_version.sh b/.github/scripts/check_version.sh deleted file mode 100644 index ea0c841..0000000 --- a/.github/scripts/check_version.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/sh - -tag=$1 -echo "Input tag: '$tag'" - -major="$(sed -rn 's/.*MAJOR.*\"(.*)\".*/\1/p' CMakeLists.txt)" -minor="$(sed -rn 's/.*MINOR.*\"(.*)\".*/\1/p' CMakeLists.txt)" -patch="$(sed -rn 's/.*PATCH.*\"(.*)\".*/\1/p' CMakeLists.txt)" -tweak="$(sed -rn 's/.*TWEAK.*\"(.*)\".*/\1/p' CMakeLists.txt)" -version="$major.$minor.$patch" -if [ $tweak != "" ]; then - version="$version.$tweak" -fi - -echo "Version in 'CMakeLists.txt' file: '$version'" - -if [ "$tag" != "" ]; then - echo "Release mode: check version consistency..." - if [ "$tag" != "$version" ]; then - echo "ERROR: the tag '$tag' is different from the version '$version' in the 'CMakeLists.txt' file" - exit 1 - fi -else - echo "Snapshot mode: fetch existing tags..." - git fetch --tags - if [ "$(git tag -l "$version")" ]; then - echo "ERROR: version '$version' has already been released, please increase the version number." - exit 1 - fi - version="$version-SNAPSHOT" -fi - -echo "PROJECT_VERSION=$version" >> $GITHUB_ENV - -echo "Retained PROJECT_VERSION=$version" diff --git a/.github/scripts/prepare_doxygen.sh b/.github/scripts/prepare_doxygen.sh deleted file mode 100644 index f87b122..0000000 --- a/.github/scripts/prepare_doxygen.sh +++ /dev/null @@ -1,38 +0,0 @@ -#!/bin/sh - -project_version=$1 - -project_name="$(head -n 1 README.md | sed 's/#//')" - -repository_name=$(git rev-parse --show-toplevel | xargs basename) - -echo "Clone $repository_name..." -git clone --branch doc https://github.com/eclipse/"$repository_name".git - -cd "$repository_name" || exit - -echo "Delete existing SNAPSHOT directory..." -rm -rf ./*-SNAPSHOT - -echo "Create target directory $project_version..." -mkdir "$project_version" - -echo "Copy Doxygen doc..." -cp -rf ../.github/doxygen/out/html/* "$project_version"/ - -echo "Update versions list..." -echo "| Version | Documents |" >list_versions.md -echo "|:---:|---|" >>list_versions.md -for directory in $(ls -rvd [0-9]*/ | sort -t. -k 1,1nr -k 2,2nr -k 3,3nr -k 4,4nr | cut -f1 -d'/'); do - echo "| $directory | [API documentation]($directory) |" >>list_versions.md -done - -echo "Computed all versions:" -cat list_versions.md - -echo "Update project name to $project_name" -sed -i "2s/.*/title: $project_name/" _config.yml - -cd .. - -echo "Local docs update finished." diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 248a504..8778107 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -1,4 +1,4 @@ -name: Build and test code +name: Build and Test code on: push: @@ -6,45 +6,9 @@ on: - main pull_request: -jobs: - build: - - strategy: - matrix: - env: - - toolchain: "toolchain/gcc-linux.cmake" - runner: ubuntu-latest - generator: "" - - toolchain: "toolchain/clang-macos.cmake" - runner: macos-latest - generator: "" - - toolchain: "\"toolchain/clang-windows.cmake\"" - runner: windows-latest - generator: "-G \"Visual Studio 17 2022\"" - - runs-on: ${{ matrix.env.runner }} - - steps: - - name: Check out repository - uses: actions/checkout@v4 - - name: Install Linux reqs - if: ${{ matrix.env.runner == 'ubuntu-latest' }} - run: | - sudo apt-get update - sudo apt-get install -y clang cmake cppcheck clang-format clang-tidy gcc pre-commit - - - name: Install macOS reqs - if: ${{ matrix.env.runner == 'macos-latest' }} - run: | - brew install llvm cppcheck clang-format gcc pre-commit - - - name: Build - run: | - cmake ${{ matrix.env.generator }} -B build -S . -DCMAKE_TOOLCHAIN_FILE=${{ matrix.env.toolchain }} - cmake --build build -j8 - - - name: Run Linux/macOS tests - if: ${{ matrix.env.runner == 'ubuntu-latest' || matrix.env.runner == 'macos-latest' }} - run: | - ./build/bin/keypleservicecpplib_ut +jobs: + call-reusable-workflow: + uses: eclipse-keyple/keyple-actions/.github/workflows/reusable-cpp-build-and-test.yml@main # NOSONAR - Same organization, trusted source + with: + test_executable_name: 'build/bin/keypleservicecpplib_ut' diff --git a/.github/workflows/publish-doc-release.yml b/.github/workflows/publish-doc-release.yml index 8e558fe..d26dd8d 100644 --- a/.github/workflows/publish-doc-release.yml +++ b/.github/workflows/publish-doc-release.yml @@ -1,47 +1,14 @@ -name: Publish API documentation - +name: Publish API documentation (release) on: release: types: [published] +permissions: + checks: write + jobs: publish-doc-release: - runs-on: ubuntu-latest - steps: - - name: Check out repository code from ${{ github.repository }}/${{ github.ref }} - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - - name: Make scripts executable - run: chmod +x ./.github/scripts/*.sh - - - name: Check version - working-directory: . - run: ./.github/scripts/check_version.sh $(echo "${{ github.ref }}" | sed -e "s,^refs/tags/,,") - - - name: Patch Doxyfile - working-directory: . - run: ./.github/scripts/patch_doxyfile.sh ${{ env.PROJECT_VERSION }} - - - name: Generate project documentation with Doxygen - uses: eclipse-keyple/keyple-actions/doxygen@0c8593c4ed6b393642a1732af1fdef84d5e59540 - with: - working-directory: .github/doxygen/ - doxyfile-path: ./Doxyfile - - - name: Prepare Doxygen doc page locally - working-directory: . - run: ./.github/scripts/prepare_doxygen.sh ${{ env.PROJECT_VERSION }} - - - name: Deploy to doc branch - run: | - git config --global user.name "Eclipse Keypop Bot" - git config --global user.email "${{ github.repository }}-bot@eclipse.org" - cd ${{ github.event.repository.name }} - git remote set-url origin "https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git" - git add . - git commit -m "docs: update ${{ github.event.inputs.version || github.ref_name }} documentation" - git push origin doc --force - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + uses: eclipse-keyple/keyple-actions/.github/workflows/reusable-publish-doxygen.yml@main # NOSONAR - Same organization, trusted source + with: + version: ${{ github.event.inputs.version || github.ref_name }} + secrets: inherit # NOSONAR - Same organization, trusted source diff --git a/.github/workflows/publish-doc-snapshot.yml b/.github/workflows/publish-doc-snapshot.yml index 7094036..d5d29a6 100644 --- a/.github/workflows/publish-doc-snapshot.yml +++ b/.github/workflows/publish-doc-snapshot.yml @@ -1,50 +1,14 @@ name: Publish API documentation (snapshot) - on: push: branches: - main - - master - - doxygen + workflow_dispatch: + +permissions: + checks: write jobs: publish-doc-snapshot: - runs-on: ubuntu-latest - steps: - - name: Check out repository code from ${{ github.repository }}/${{ github.ref }} - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - - name: Make scripts executable - run: chmod +x ./.github/scripts/*.sh - - - name: Check version - working-directory: . - run: ./.github/scripts/check_version.sh - - - name: Patch Doxyfile - working-directory: . - run: ./.github/scripts/patch_doxyfile.sh ${{ env.PROJECT_VERSION }} - - - name: Generate project documentation with Doxygen - uses: eclipse-keyple/keyple-actions/doxygen@0c8593c4ed6b393642a1732af1fdef84d5e59540 - with: - working-directory: .github/doxygen/ - doxyfile-path: ./Doxyfile - - - name: Prepare Doxygen doc page locally - working-directory: . - run: ./.github/scripts/prepare_doxygen.sh ${{ env.PROJECT_VERSION }} - - - name: Deploy to doc branch - run: | - git config --global user.name "Eclipse Keypop Bot" - git config --global user.email "${{ github.repository }}-bot@eclipse.org" - cd ${{ github.event.repository.name }} - git remote set-url origin "https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git" - git add . - git diff --quiet && git diff --staged --quiet || git commit -m "docs: update snapshot documentation" - git push origin doc --force - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + uses: eclipse-keyple/keyple-actions/.github/workflows/reusable-publish-doxygen.yml@main # NOSONAR - Same organization, trusted source + secrets: inherit # NOSONAR - Same organization, trusted source diff --git a/src/main/mainpage.dox b/src/main/mainpage.dox new file mode 100644 index 0000000..4dbccbb --- /dev/null +++ b/src/main/mainpage.dox @@ -0,0 +1,23 @@ +/** + * @mainpage Keyple Service C++ Library + * + * @section overview Overview + * + * The **Keyple Service C++ Library** contains the Keyple core components, + * providing the fundamental services and orchestration layer for the + * Keyple middleware architecture. + * + * @section key_features Key Features + * + * - Core Keyple service components + * - Plugin and reader management + * - Card selection and transaction orchestration + * - Event-driven architecture support + * - Service layer coordination + * + * @section resources Resources + * + * - **Documentation**: [keyple.org](https://keyple.org) + * - **API Documentation**: [docs.keyple.org/keyple-service-cpp-lib](https://docs.keyple.org/keyple-service-cpp-lib) + * - **Examples**: [github.com/eclipse/keyple-cpp-example](https://github.com/eclipse/keyple-cpp-example) + */