diff options
Diffstat (limited to '.github/workflows')
-rw-r--r-- | .github/workflows/build-and-test-deb.yml | 114 | ||||
-rw-r--r-- | .github/workflows/build-and-test-msys.yml | 90 | ||||
-rw-r--r-- | .github/workflows/build-and-test-rh.yml | 98 | ||||
-rw-r--r-- | .github/workflows/build-and-test.yml | 142 | ||||
-rw-r--r-- | .github/workflows/codeql.yml | 86 | ||||
-rw-r--r-- | .github/workflows/coverage.yml | 71 | ||||
-rw-r--r-- | .github/workflows/coverity.yml | 63 | ||||
-rw-r--r-- | .github/workflows/lint.yml | 56 | ||||
-rw-r--r-- | .github/workflows/nix.yml | 64 |
9 files changed, 784 insertions, 0 deletions
diff --git a/.github/workflows/build-and-test-deb.yml b/.github/workflows/build-and-test-deb.yml new file mode 100644 index 0000000..a9c0eb4 --- /dev/null +++ b/.github/workflows/build-and-test-deb.yml @@ -0,0 +1,114 @@ +# +# Copyright 2021-2023 Ribose Inc. (https://www.ribose.com) +# +# Permission is hereby granted, free of charge, to any person obtaining a copy of +# this software and associated documentation files (the "Software"), to deal in +# the Software without restriction, including without limitation the rights to +# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +# the Software, and to permit persons to whom the Software is furnished to do so, +# subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +# FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# + +name: build-and-test-deb + +on: + push: + branches: [ main ] + pull_request: + workflow_dispatch: + +concurrency: + group: '${{ github.workflow }}-${{ github.job }}-${{ github.head_ref || github.ref_name }}' + cancel-in-progress: true + +env: +# Looks like the last version that supports i386 + CMAKE_VERSION: '3.20.6-2' + MAKEFLAGS: j4 + +jobs: + build-and-test: + name: ${{ matrix.image }}-${{ matrix.env.CC }} shared lib ${{ matrix.shared }} + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + image: [ 'i386/debian:10', 'i386/debian:11', 'amd64/debian:11' ] + env: [ {CC: gcc, CXX: g++}, {CC: clang, CXX: clang++} ] + shared: [on, off] + + container: ${{ matrix.image }} + env: ${{ matrix.env }} + steps: + - name: Install packages + run: | + apt-get update + apt-get -y install sudo git wget build-essential libssl-dev software-properties-common + + - name: Checkout + # Because i386 support v1 only (no node run-time) + uses: actions/checkout@v1 + with: + fetch-depth: 1 + + - name: Install cmake/i386 + if: startsWith(matrix.image, 'i386') + run: | + wget -nv https://github.com/xpack-dev-tools/cmake-xpack/releases/download/v${{ env.CMAKE_VERSION }}/xpack-cmake-${{ env.CMAKE_VERSION }}-linux-ia32.tar.gz + tar -zxf xpack-cmake-${{ env.CMAKE_VERSION }}-linux-ia32.tar.gz --directory /usr/local --strip-components=1 --skip-old-files + + - name: Install cmake/amd64 + if: startsWith(matrix.image, 'amd64') + run: | + wget -nv https://github.com/xpack-dev-tools/cmake-xpack/releases/download/v${{ env.CMAKE_VERSION }}/xpack-cmake-${{ env.CMAKE_VERSION }}-linux-x64.tar.gz + tar -zxf xpack-cmake-${{ env.CMAKE_VERSION }}-linux-x64.tar.gz --directory /usr/local --strip-components=1 --skip-old-files + + - name: Install clang + if: matrix.env.CC == 'clang' + run: | + wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key|sudo apt-key add - + apt-add-repository "deb http://apt.llvm.org/stretch/ llvm-toolchain-stretch main" + apt-get install -y clang + + - name: Adjust environment + run: | + echo "SEXP_INSTALL_PATH=$PWD/install" >> $GITHUB_ENV + echo "SHARED_LIB=${{ matrix.shared }}" >> $GITHUB_ENV + + - name: Configure + run: cmake . -Bbuild -DCMAKE_INSTALL_PREFIX=${{ env.SEXP_INSTALL_PATH }} -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=${{ matrix.shared }} + + - name: Build + run: cmake --build build --config Release + + - name: Run tests + run: ctest --test-dir build --output-on-failure + + - name: Checkout shell test framework/amd64 only + # i386 supports actions/checkout@v1 only (no Node.js 32-bit binary) + # and and actions/checkout@v1 has some issues with nested repositories + if: startsWith(matrix.image, 'amd64') + uses: actions/checkout@v3 + with: + repository: kward/shunit2 + path: ${{github.workspace}}/tests/shunit2 + fetch-depth: 1 + + - name: Install + run: cmake --install build + + - name: Run additional tests + # See above, just assume that in i386 config it was installed correctly + if: startsWith(matrix.image, 'amd64') + shell: bash + run: tests/scripts/tests.sh diff --git a/.github/workflows/build-and-test-msys.yml b/.github/workflows/build-and-test-msys.yml new file mode 100644 index 0000000..99e2096 --- /dev/null +++ b/.github/workflows/build-and-test-msys.yml @@ -0,0 +1,90 @@ +# +# Copyright 2021-2023 Ribose Inc. (https://www.ribose.com) +# +# Permission is hereby granted, free of charge, to any person obtaining a copy of +# this software and associated documentation files (the "Software"), to deal in +# the Software without restriction, including without limitation the rights to +# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +# the Software, and to permit persons to whom the Software is furnished to do so, +# subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +# FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# + +name: build-and-test-msys + +on: + push: + branches: [ main ] + pull_request: + workflow_dispatch: + +concurrency: + group: '${{ github.workflow }}-${{ github.job }}-${{ github.head_ref || github.ref_name }}' + cancel-in-progress: true + +env: + MAKEFLAGS: j4 + +defaults: + run: + shell: msys2 {0} +jobs: + build-and-test: + name: MSys-${{ matrix.msystem }} shared lib ${{ matrix.shared }} + runs-on: windows-latest + strategy: + fail-fast: false + matrix: + msystem: [ ucrt64, mingw64, clang64 ] + shared: [on, off] + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + fetch-depth: 1 + + - name: Install MSys + uses: msys2/setup-msys2@v2 + with: + msystem: ${{ matrix.msystem }} + pacboy: >- + toolchain:p + cmake:p + path-type: minimal + + - name: Adjust environment + shell: bash + run: | + echo "SEXP_INSTALL_PATH=$(cygpath -u $PWD/install)" >> $GITHUB_ENV + echo "SHARED_LIB=${{ matrix.shared }}" >> $GITHUB_ENV + + - name: Configure + run: cmake -Bbuild -DCMAKE_INSTALL_PREFIX=${{ env.SEXP_INSTALL_PATH }} -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=${{ matrix.shared }} + + - name: Build + run: cmake --build build --config Release + + - name: Run tests + run: ctest --test-dir build --output-on-failure + + - name: Checkout shell test framework + uses: actions/checkout@v3 + with: + repository: kward/shunit2 + path: ${{ github.workspace }}/tests/shunit2 + fetch-depth: 1 + + - name: Install + run: cmake --install build + + - name: Run additional tests + run: tests/scripts/tests.sh diff --git a/.github/workflows/build-and-test-rh.yml b/.github/workflows/build-and-test-rh.yml new file mode 100644 index 0000000..c30fc19 --- /dev/null +++ b/.github/workflows/build-and-test-rh.yml @@ -0,0 +1,98 @@ +# +# Copyright 2021-2023 Ribose Inc. (https://www.ribose.com) +# +# Permission is hereby granted, free of charge, to any person obtaining a copy of +# this software and associated documentation files (the "Software"), to deal in +# the Software without restriction, including without limitation the rights to +# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +# the Software, and to permit persons to whom the Software is furnished to do so, +# subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +# FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# + +name: build-and-test-rh + +on: + push: + branches: [ main ] + pull_request: + workflow_dispatch: + +concurrency: + group: '${{ github.workflow }}-${{ github.job }}-${{ github.head_ref || github.ref_name }}' + cancel-in-progress: true + +env: + MAKEFLAGS: j4 + +jobs: + build-and-test: + name: ${{ matrix.image }}-${{ matrix.env.CC }} shared lib ${{ matrix.shared }} + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + image: [ 'centos:7', 'tgagor/centos:stream8', 'quay.io/centos/centos:stream9', 'fedora:35', 'fedora:36' ] + env: [ {CC: gcc, CXX: g++}, {CC: clang, CXX: clang++} ] + shared: [ on, off ] + container: ${{ matrix.image }} + env: ${{ matrix.env }} + steps: + - name: Install packages CentOS 7 + if: matrix.image == 'centos:7' + run: | + yum -y install http://opensource.wandisco.com/centos/7/git/x86_64/wandisco-git-release-7-2.noarch.rpm + yum -y install sudo git make wget gcc gcc-c++ clang + wget -nv https://github.com/Kitware/CMake/releases/download/v3.24.3/cmake-3.24.3-linux-x86_64.sh + chmod a+x cmake-3.24.3-linux-x86_64.sh + ./cmake-3.24.3-linux-x86_64.sh --skip-license --exclude-subdir --prefix=/usr/local + + - name: Install packages not CentOS 7 + if: matrix.image != 'centos:7' + run: yum -y install sudo git gcc gcc-c++ make cmake clang + + - name: Checkout + uses: actions/checkout@v3 + with: + fetch-depth: 1 + + - name: Adjust environment + run: | + echo "SEXP_INSTALL_PATH=$PWD/install" >> $GITHUB_ENV + echo "SHARED_LIB=${{ matrix.shared }}" >> $GITHUB_ENV + + - name: Configure + run: cmake . -Bbuild -DCMAKE_INSTALL_PREFIX=${{ env.SEXP_INSTALL_PATH }} -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=${{ matrix.shared }} + + - name: Build + run: cmake --build build --config Release + + - name: Run tests + run: ctest --test-dir build --output-on-failure + + - name: Install + run: cmake --install build + + - name: Install xargs + if: matrix.image == 'fedora:35' + run: sudo yum -y install findutils + + - name: Checkout shell test framework + uses: actions/checkout@v3 + with: + repository: kward/shunit2 + path: ${{github.workspace}}/tests/shunit2 + fetch-depth: 1 + + - name: Run additional tests + shell: bash + run: tests/scripts/tests.sh diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml new file mode 100644 index 0000000..ca1ffa6 --- /dev/null +++ b/.github/workflows/build-and-test.yml @@ -0,0 +1,142 @@ +# +# Copyright 2021-2023 Ribose Inc. (https://www.ribose.com) +# +# Permission is hereby granted, free of charge, to any person obtaining a copy of +# this software and associated documentation files (the "Software"), to deal in +# the Software without restriction, including without limitation the rights to +# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +# the Software, and to permit persons to whom the Software is furnished to do so, +# subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +# FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# + +name: build-and-test + +on: + push: + branches: [ main ] + pull_request: + workflow_dispatch: + +concurrency: + group: '${{ github.workflow }}-${{ github.job }}-${{ github.head_ref || github.ref_name }}' + cancel-in-progress: true + +env: + MAKEFLAGS: j4 + +jobs: + build-and-test: + runs-on: ${{ matrix.os }} + name: ${{ matrix.os }}-${{ matrix.env.CC }} shared lib ${{ matrix.shared }} + strategy: + fail-fast: false + matrix: + os: [ ubuntu-20.04, macos-11, windows-2019 ] + env: [ { } ] + shared: [on, off] + # on macos gcc is an alias to clang by default, so there is no real value in macos clang run + include: + - { os: ubuntu-20.04, env: { CC: clang, CXX: clang++ }, shared: on } + - { os: ubuntu-20.04, env: { CC: clang, CXX: clang++ }, shared: off } + # Builds sexp dll with MSVC is not supported + exclude: + - { os: windows-2019, env: { }, shared: on } + + env: ${{ matrix.env }} + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + fetch-depth: 1 + + - name: Adjust environment for Windows build + if: runner.os == 'Windows' + shell: bash + run: echo "OSTYPE=windows" >> $GITHUB_ENV + + - name: Adjust environment + run: echo "SHARED_LIB=${{ matrix.shared }}" >> $GITHUB_ENV + + - name: Configure + run: cmake -Bbuild -DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/install -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=${{ matrix.shared }} + + - name: Build + run: cmake --build build --config Release + + - name: Run tests + run: ctest --test-dir build --output-on-failure + + - name: Checkout shell test framework + uses: actions/checkout@v3 + with: + repository: kward/shunit2 + path: ${{github.workspace}}/tests/shunit2 + fetch-depth: 1 + + - name: Install + run: cmake --install build + + - name: Run additional tests + shell: bash + run: tests/scripts/tests.sh + + offline-gtest: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + fetch-depth: 1 + + - name: Install googletest + run: | + sudo apt-get -y install googletest + sudo cmake -B/usr/src/googletest/build /usr/src/googletest + sudo cmake --build /usr/src/googletest/build + sudo cmake --install /usr/src/googletest/build + + - name: Configure + run: | + cmake -Bbuild \ + -DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/install \ + -DCMAKE_BUILD_TYPE=Release \ + -DDOWNLOAD_GTEST=OFF + + - name: Build + run: cmake --build build + + - name: Run tests + run: ctest --test-dir build --output-on-failure + + sanitizers: + runs-on: ubuntu-latest + env: + CC: clang + CXX: clang++ + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + fetch-depth: 1 + + - name: Configure + run: | + cmake -Bbuild \ + -DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/install \ + -DWITH_SANITIZERS=ON + + - name: Build + run: cmake --build build + + - name: Run tests + run: ctest --test-dir build --output-on-failure diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml new file mode 100644 index 0000000..ed38ede --- /dev/null +++ b/.github/workflows/codeql.yml @@ -0,0 +1,86 @@ +# +# Copyright 2021-2023 Ribose Inc. (https://www.ribose.com) +# +# Permission is hereby granted, free of charge, to any person obtaining a copy of +# this software and associated documentation files (the "Software"), to deal in +# the Software without restriction, including without limitation the rights to +# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +# the Software, and to permit persons to whom the Software is furnished to do so, +# subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +# FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# + +name: "CodeQL" + +on: + push: + branches: [ "main" ] + pull_request: + # The branches below must be a subset of the branches above + branches: [ "main" ] + +concurrency: + group: '${{ github.workflow }}-${{ github.job }}-${{ github.head_ref || github.ref_name }}' + cancel-in-progress: true + +jobs: + analyze: + name: Analyze + runs-on: ubuntu-latest + permissions: + actions: read + contents: read + security-events: write + + strategy: + fail-fast: false + matrix: + language: [ 'cpp' ] + # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ] + # Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + # Initializes the CodeQL tools for scanning. + - name: Initialize CodeQL + uses: github/codeql-action/init@v2 + with: + languages: ${{ matrix.language }} + # If you wish to specify custom queries, you can do so here or in a config file. + # By default, queries listed here will override any specified in a config file. + # Prefix the list here with "+" to use these queries and those in the config file. + + # Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs + # queries: security-extended,security-and-quality + + + # Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java). + # If this step fails, then you should remove it and run the build manually (see below) + - name: Autobuild + uses: github/codeql-action/autobuild@v2 + + # âšī¸ Command-line programs to run using the OS shell. + # đ See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun + + # If the Autobuild fails above, remove it and uncomment the following three lines. + # modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance. + + # - run: | + # echo "Run, Build Application using script" + # ./location_of_script_within_repo/buildscript.sh + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v2 + with: + category: "/language:${{matrix.language}}" diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml new file mode 100644 index 0000000..55df2ff --- /dev/null +++ b/.github/workflows/coverage.yml @@ -0,0 +1,71 @@ +# +# Copyright 2021-2023 Ribose Inc. (https://www.ribose.com) +# +# Permission is hereby granted, free of charge, to any person obtaining a copy of +# this software and associated documentation files (the "Software"), to deal in +# the Software without restriction, including without limitation the rights to +# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +# the Software, and to permit persons to whom the Software is furnished to do so, +# subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +# FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# + +name: coverage + +on: + push: + branches: [ main ] + pull_request: + workflow_dispatch: + +concurrency: + group: '${{ github.workflow }}-${{ github.job }}-${{ github.head_ref || github.ref_name }}' + cancel-in-progress: true + +jobs: + coverage: + runs-on: ubuntu-latest + env: + CC: gcc + CXX: g++ + CODECOV_TOKEN: dbb06ac6-97ef-4d04-a0c6-24f7e3d8e1d6 + MAKEFLAGS: j4 + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + fetch-depth: 1 + + - name: Configure + run: | + cmake -Bbuild \ + -DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/install \ + -DWITH_COVERAGE=ON + + - name: Build + run: cmake --build build + + - name: Run tests + run: ctest --test-dir build --output-on-failure + + - name: Upload to codecov.io + run: | + curl -Os https://uploader.codecov.io/latest/linux/codecov + curl https://uploader.codecov.io/verification.gpg | gpg --no-default-keyring --keyring trustedkeys.gpg --import + curl -Os https://uploader.codecov.io/latest/linux/codecov + curl -Os https://uploader.codecov.io/latest/linux/codecov.SHA256SUM + curl -Os https://uploader.codecov.io/latest/linux/codecov.SHA256SUM.sig + gpgv codecov.SHA256SUM.sig codecov.SHA256SUM + shasum -a 256 -c codecov.SHA256SUM + find "build" -type f -name '*.gcno' -exec gcov -p {} + + chmod +x codecov + ./codecov -t ${{ env.CODECOV_TOKEN }} diff --git a/.github/workflows/coverity.yml b/.github/workflows/coverity.yml new file mode 100644 index 0000000..5c74eeb --- /dev/null +++ b/.github/workflows/coverity.yml @@ -0,0 +1,63 @@ +# +# Copyright 2021-2023 Ribose Inc. (https://www.ribose.com) +# +# Permission is hereby granted, free of charge, to any person obtaining a copy of +# this software and associated documentation files (the "Software"), to deal in +# the Software without restriction, including without limitation the rights to +# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +# the Software, and to permit persons to whom the Software is furnished to do so, +# subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +# FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# + +name: coverity + +on: + push: + branches: [ main ] + pull_request: + workflow_dispatch: + +concurrency: + group: '${{ github.workflow }}-${{ github.job }}-${{ github.head_ref || github.ref_name }}' + cancel-in-progress: true + +jobs: + coverity: + runs-on: ubuntu-latest + env: + CC: gcc + CXX: g++ + MAKEFLAGS: j4 + COVERITY_TOKEN: qjcM1CWLcq9PJB3yL0ZXIw + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + fetch-depth: 1 + + - name: Install googletest + run: | + sudo apt-get -y install googletest + sudo cmake -B/usr/src/googletest/build /usr/src/googletest + sudo cmake --build /usr/src/googletest/build + sudo cmake --install /usr/src/googletest/build + + - name: Configure + run: cmake -Bbuild -DDOWNLOAD_GTEST=OFF + + - name: Coverity Scan + uses: vapier/coverity-scan-action@v1 + with: + email: maxirmx@sw.consulting + token: ${{ env.COVERITY_TOKEN }} + command: cmake --build build diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000..0a80e40 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,56 @@ +# +# Copyright 2021-2023 Ribose Inc. (https://www.ribose.com) +# +# Permission is hereby granted, free of charge, to any person obtaining a copy of +# this software and associated documentation files (the "Software"), to deal in +# the Software without restriction, including without limitation the rights to +# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +# the Software, and to permit persons to whom the Software is furnished to do so, +# subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +# FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# + +name: lint + +on: + workflow_dispatch: + + pull_request: + paths-ignore: + - '/.*' + - '!.clang-format' + - '**.adoc' + - '**.md' + +jobs: + clang-format: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: DoozyX/clang-format-lint-action@v0.11 + with: + source: '.' + extensions: 'h,cpp,c' + clangFormatVersion: 11 +# inplace: True +# - uses: EndBug/add-and-commit@v9 +# with: +# author_name: A robot on behalf of Maxim Samsonov +# author_email: m.samsonov@computer.org +# message: 'Committing clang-format changes' +# env: +# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + shellcheck: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: ludeeus/action-shellcheck@master diff --git a/.github/workflows/nix.yml b/.github/workflows/nix.yml new file mode 100644 index 0000000..ed19bce --- /dev/null +++ b/.github/workflows/nix.yml @@ -0,0 +1,64 @@ +# +# Copyright 2021-2023 Ribose Inc. (https://www.ribose.com) +# +# Permission is hereby granted, free of charge, to any person obtaining a copy of +# this software and associated documentation files (the "Software"), to deal in +# the Software without restriction, including without limitation the rights to +# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +# the Software, and to permit persons to whom the Software is furnished to do so, +# subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +# FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# + +name: nix + +on: + push: + branches: [ main ] + pull_request: + workflow_dispatch: + +concurrency: + group: '${{ github.workflow }}-${{ github.job }}-${{ github.head_ref || github.ref_name }}' + cancel-in-progress: true + +jobs: + build: + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, macos-latest] + + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + fetch-depth: 1 + + - name: nix setup + uses: cachix/install-nix-action@v22 + with: + nix_path: nixpkgs=channel:nixos-unstable + + - name: nix build + run: nix build + + - name: Checkout shell test framework + uses: actions/checkout@v3 + with: + repository: kward/shunit2 + path: ${{github.workspace}}/tests/shunit2 + fetch-depth: 1 + + - name: Run tests + run: DIR_INSTALL=result tests/scripts/tests.sh |