diff --git a/.commitlintrc.json b/.commitlintrc.json new file mode 100644 index 0000000..99487db --- /dev/null +++ b/.commitlintrc.json @@ -0,0 +1,17 @@ +{ + "extends": [ + "@commitlint/config-conventional" + ], + "rules": { + "subject-case": [ + 2, + "always", + [ + "sentence-case", + "start-case", + "pascal-case", + "upper-case" + ] + ] + } +} diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 0000000..a92f6bd --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1,6 @@ +# SPDX-FileCopyrightText: 2022 leha-bot and contributors +# +# SPDX-License-Identifier: BSL-1.0 OR BlueOak-1.0.0 + +# Default assignment +* @leha-bot diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 584d3b7..4b5ab7a 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -3,8 +3,16 @@ # SPDX-License-Identifier: BSL-1.0 OR BlueOak-1.0.0 version: 2 + updates: + # GitHub Actions - package-ecosystem: "github-actions" directory: "/" schedule: interval: "weekly" + target-branch: master + groups: + actions-minor: + update-types: + - minor + - patch diff --git a/.github/workflows/build-project.yml b/.github/workflows/build-project.yml new file mode 100644 index 0000000..4504807 --- /dev/null +++ b/.github/workflows/build-project.yml @@ -0,0 +1,108 @@ +# SPDX-FileCopyrightText: 2022 leha-bot and contributors +# +# SPDX-License-Identifier: BSL-1.0 OR BlueOak-1.0.0 + +name: 'Build project' + +on: + push: + branches: + - '**' + paths: + - '.github/workflows/**' + - 'include/**' + - 'src/**' + - 'tests/**' + - '**/CMakeLists.txt' + pull_request: + branches: + - 'master' + paths: + - '.github/workflows/**' + - 'include/**' + - 'src/**' + - 'tests/**' + - '**/CMakeLists.txt' + +defaults: + run: + shell: sh + +jobs: + build: + name: 'Build' + + strategy: + matrix: + system: + - windows-2022 + - macos-14 + - ubuntu-22.04 + config: + - Release + + # The CMake configure and build commands are platform agnostic and should work equally well on Windows or Mac. + # You can convert this to a matrix build if you need cross-platform coverage. + # See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix + runs-on: ${{ matrix.system }} + + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Setup Conan + uses: imesense/gha-setup-conan@v0.1 + + # Detect the build profile for futher Conan interactions + - name: Detect build profile + run: | + conan profile detect + + # Install dependencies in the same build folder as will be used in CMake. This path also will be used for CMake's find_package() mode + # via CMAKE_MODULE_PATH and CMAKE_PREFIX_PATH + - name: Install dependencies + run: | + conan install . \ + --build=missing \ + -of conan-deps \ + -s build_type=${{ matrix.config }} + + - name: Set path (Windows) + if: ${{ runner.os == 'Windows' }} + shell: pwsh + run: | + $github_workspace = "${{ github.workspace }}" + $workspace = ($github_workspace -replace '\\','/') + Add-Content -Path $env:GITHUB_ENV -Value "workspace=$workspace" + + - name: Set path (macOS/Linux) + if: ${{ runner.os != 'Windows' }} + run: | + export workspace=${{ github.workspace }} + echo "workspace=$workspace" >> $GITHUB_ENV + + - name: Configure project + # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make. + # See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type + # Also set PREFIX and MODULE paths for find_package() via CMAKE_MODULE_PATH and CMAKE_PREFIX_PATH variables. + # See https://cmake.org/cmake/help/latest/command/find_package.html?highlight=find_package for search modes. + run: | + cmake -B ${{ env.workspace }}/build \ + -DCMAKE_BUILD_TYPE=${{ matrix.config }} \ + -DCMAKE_PREFIX_PATH="${{ env.workspace }}/conan-deps" \ + -DCMAKE_MODULE_PATH="${{ env.workspace }}/conan-deps" + + - name: Build project + working-directory: ${{ env.workspace }}/build + # Build your program with the given configuration + run: | + cmake --build . --config ${{ matrix.config }} + + - name: Test project + working-directory: ${{ env.workspace }}/build + # Execute tests defined by the CMake configuration. + # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail + run: | + ctest -C ${{ matrix.config }} diff --git a/.github/workflows/reuse.yml b/.github/workflows/check-reuse.yml similarity index 57% rename from .github/workflows/reuse.yml rename to .github/workflows/check-reuse.yml index 8f812b9..f60a110 100644 --- a/.github/workflows/reuse.yml +++ b/.github/workflows/check-reuse.yml @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: BSL-1.0 OR BlueOak-1.0.0 -name: REUSE Compliance +name: 'Check compliance' on: push: @@ -14,10 +14,13 @@ on: jobs: check: - name: REUSE compliance check + name: 'Check' + runs-on: ubuntu-latest + steps: - - name: Fetching sources - uses: actions/checkout@v4 - - name: Checking REUSE compliance - uses: fsfe/reuse-action@v3 + - name: Fetching sources + uses: actions/checkout@v4 + + - name: Check compliance + uses: fsfe/reuse-action@v3 diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml deleted file mode 100644 index 0bfdd5e..0000000 --- a/.github/workflows/cmake.yml +++ /dev/null @@ -1,58 +0,0 @@ -# SPDX-FileCopyrightText: 2022 leha-bot and contributors -# -# SPDX-License-Identifier: BSL-1.0 OR BlueOak-1.0.0 - -name: CMake + Conan (GCC 10) - -on: - push: - branches: [ "master" ] - pull_request: - branches: [ "master" ] - -env: - # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) - BUILD_TYPE: Release - CC: gcc-10 - CXX: g++-10 - -jobs: - build: - # The CMake configure and build commands are platform agnostic and should work equally well on Windows or Mac. - # You can convert this to a matrix build if you need cross-platform coverage. - # See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v4 - - # Install conan - - name: Get Conan - uses: turtlebrowser/get-conan@v1.2 - - # Detect the build profile for futher Conan interactions. - - name: Detect Conan build profile - run: conan profile detect - - # Install dependencies in the same build folder as will be used in CMake. This path also will be used for CMake's find_package() mode - # via CMAKE_MODULE_PATH and CMAKE_PREFIX_PATH. - - name: Install dependencies - run: conan install . --build=missing -of ${{github.workspace}}/conan-deps -s build_type=${{env.BUILD_TYPE}} - - - name: Configure CMake - # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make. - # See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type - # Also set PREFIX and MODULE paths for find_package() via CMAKE_MODULE_PATH and CMAKE_PREFIX_PATH variables. - # See https://cmake.org/cmake/help/latest/command/find_package.html?highlight=find_package for search modes. - run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_PREFIX_PATH=${{github.workspace}}/conan-deps -DCMAKE_MODULE_PATH=${{github.workspace}}/conan-deps - - - name: Build - # Build your program with the given configuration - run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} - - - name: Test - working-directory: ${{github.workspace}}/build - # Execute tests defined by the CMake configuration. - # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail - run: ctest -C ${{env.BUILD_TYPE}} - diff --git a/.github/workflows/commitlint.yml b/.github/workflows/lint-commits.yml similarity index 65% rename from .github/workflows/commitlint.yml rename to .github/workflows/lint-commits.yml index 356bec0..3702721 100644 --- a/.github/workflows/commitlint.yml +++ b/.github/workflows/lint-commits.yml @@ -2,19 +2,28 @@ # # SPDX-License-Identifier: BSL-1.0 OR BlueOak-1.0.0 -name: commitlint +name: 'Lint commits' + on: push: + branches: + - '**' pull_request: - branches: [ master, dev ] + branches: + - master + - dev jobs: - commitlint: + lint: + name: 'Lint' + runs-on: ubuntu-latest + steps: - - name: Checkout repository + - name: Checkout uses: actions/checkout@v4 with: fetch-depth: 0 - - name: Commitlint + + - name: Lint uses: remarkablemark/commitlint@v1 diff --git a/.reuse/dep5 b/.reuse/dep5 index 41ef975..238ec82 100644 --- a/.reuse/dep5 +++ b/.reuse/dep5 @@ -6,3 +6,7 @@ Source: https://github.com/leha-bot/std_version Files: *.md Copyright: 2022 leha-bot and contributors License: BSL-1.0 OR BlueOak-1.0.0 + +Files: *.json +Copyright: 2022 leha-bot and contributors +License: BSL-1.0 OR BlueOak-1.0.0 diff --git a/package.json b/package.json new file mode 100644 index 0000000..cb5acc9 --- /dev/null +++ b/package.json @@ -0,0 +1,6 @@ +{ + "dependencies": { + "@commitlint/cli": "latest", + "@commitlint/config-conventional": "latest" + } +}