From 95cb9bebf57ae902d38cc6b1271641236c1b892a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrgen=20M=C3=BClbert?= Date: Fri, 1 Nov 2024 10:04:51 +0100 Subject: [PATCH] fix: issues on ci.yml and style.yml --- .github/workflows/ci.yml | 14 ++-- .github/workflows/styles.yml | 152 ++++++++++++++--------------------- 2 files changed, 67 insertions(+), 99 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 78564ac0..ca46d4d6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -146,8 +146,10 @@ jobs: os: [ubuntu-latest, ubuntu-22.04] generator: - Ninja - compiler: g++-10 - ccompiler: gcc-10 + compiler: + - g++-10 + ccompiler: + - gcc-10 build_type: - Debug qt_version: [6.7.2] @@ -287,7 +289,7 @@ jobs: compiler: clang++-14 ccompiler: clang-14 clang-tidy: "" - generator: Unix Makefiles + generator: Ninja - name: windows-latest-cl.exe os: windows-latest build_type: Release @@ -349,8 +351,8 @@ jobs: ninja-build \ ccache echo "CCACHE_DIR=${{github.workspace}}/ccache" >> "$GITHUB_ENV" - echo "CXX=clang++-12" >> "$GITHUB_ENV" - echo "CC=clang-12" >> "$GITHUB_ENV" + echo "CXX=${{matrix.compiler}}" >> "$GITHUB_ENV" + echo "CC=${{matrix.ccompiler}}" >> "$GITHUB_ENV" - name: ⚙️ 🍎 Install macos dependencies if: runner.os == 'macOS' env: @@ -399,8 +401,6 @@ jobs: uses: jurplel/install-qt-action@f03f05556819ceb3781ee2f455ec44c339d683c0 # v4.0.0 with: version: ${{ env.QT_VERSION }} - # host: ${{ runner.os }} - target: ${{ env.QT_TARGET }} arch: ${{ matrix.qt_arch }} dir: "${{ github.workspace }}/build/" diff --git a/.github/workflows/styles.yml b/.github/workflows/styles.yml index 4d91124f..6653b24b 100644 --- a/.github/workflows/styles.yml +++ b/.github/workflows/styles.yml @@ -1,61 +1,53 @@ ---- name: Style - on: push: branches: [main, develop, release] - paths-ignore: - - 'docs/**' - - '.github/ISSUE_TEMPLATE/**' - - 'docker/**' - - '**.md' - - '!docs/building-cmake.md' - - 'changelog.txt' - - 'LICENSE' - - '.github/**' - - '!.github/workflows/styles.yml' - - 'snap/**' - - 'build/**' - - 'assets/**' - - 'Docker/**' - - 'report/**' - - 'resources/**' - + - docs/** + - .github/ISSUE_TEMPLATE/** + - docker/** + - "**.md" + - "!docs/building-cmake.md" + - changelog.txt + - LICENSE + - .github/** + - "!.github/workflows/styles.yml" + - snap/** + - build/** + - assets/** + - Docker/** + - report/** + - resources/** pull_request: types: [opened, reopened] paths-ignore: - - 'docs/**' - - '.github/ISSUE_TEMPLATE/**' - - 'docker/**' - - '**.md' - - '!docs/building-cmake.md' - - 'changelog.txt' - - 'LICENSE' - - '.github/**' - - '!.github/workflows/styles.yml' - - 'snap/**' - - 'build/**' - - 'assets/**' - - 'Docker/**' - - 'report/**' - - 'resources/**' - + - docs/** + - .github/ISSUE_TEMPLATE/** + - docker/** + - "**.md" + - "!docs/building-cmake.md" + - changelog.txt + - LICENSE + - .github/** + - "!.github/workflows/styles.yml" + - snap/** + - build/** + - assets/** + - Docker/** + - report/** + - resources/** release: types: [published] - env: - SOURCE_CACHE: ${{ github.workspace }}/src - QT_VERSION: 6.2.0 + SOURCE_CACHE: ${{ github.workspace }}apps/ + QT_VERSION: 6.7.2 # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) BUILD_TYPE: Debug PRODUCT: jmbde targetName: jmbde - jobs: build: runs-on: ubuntu-latest - strategy: matrix: os: [ubuntu-latest] @@ -67,45 +59,29 @@ jobs: cc: [clang-12] cxx: [clang-12] fail-fast: true - steps: - - name: '🧰 Checkout Source Code' - if: github.event_name == 'push' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - ref: master - - - name: '🧰 Checkout Source Code' - if: github.event_name == 'pull_request' - uses: actions/checkout@v3 - with: - fetch-depth: 0 - ref: ${{ github.event.pull_request.head.sha }} + - name: 🧰 Checkout Source Code + # Checkout the repository to the GitHub Actions runner + uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5 - uses: actions/cache@v2 with: path: '**/src' - key: ${{ github.workflow }}-src-${{ hashFiles('**/CMakeLists.txt', '**/*.cmake') - }} - + key: ${{ github.workflow }}-src-${{ hashFiles('**/CMakeLists.txt', '**/*.cmake') }} - name: '⚙️ Install dependencies' run: | sudo apt-get -y -qq update sudo apt-get -y --no-install-recommends install \ ninja-build - - name: '⚙️ install python dependencies' run: | pipx install conan - - name: '⚙️ Cache Qt' id: cache-qt uses: actions/cache@v1 # not v2! with: path: '${{ github.workspace }}/Qt' key: QtCache-${{ matrix.platform }}-{{ matrix.arch }}-${{ env.QT_VERSION }} - - name: '⚙️ Install Qt' uses: jurplel/install-qt-action@v2 with: @@ -114,12 +90,10 @@ jobs: arch: ${{ matrix.qt_arch }} # modules: 'qtscript' cached: ${{ steps.cache-qt.outputs.cache-hit }} - - name: Create Build Environment # Some projects don't allow in-source building, so create a separate build directory # We'll use this as our working directory for all subsequent commands - run: cmake -E make_directory ${{runner.workspace}}/build - + run: cmake -E make_directory ${{githubt.workspace}}/build - name: Configure CMake # Use a bash shell so we can use the same syntax for environment variable # access regardless of the host operating system @@ -127,7 +101,7 @@ jobs: env: CC: ${{ matrix.cc }} CXX: ${{ matrix.cxx}} - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build # Note the current convention is to use the -S and -B options here to specify source # and build directories, but this is only available with CMake 3.13 and higher. # The CMake binaries on the Github Actions machines are (as of this writing) 3.12 @@ -136,22 +110,19 @@ jobs: -G ${{matrix.config.generator}} \ -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} \ -DENABLE_CLANG_FORMAT=ON - - name: Build - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash # Execute the build. You can specify a specific target with "--target " run: | cmake --build . \ --config ${{ env.BUILD_TYPE }} \ -j$(nproc) - # Run only on linux - name: Validate QML and JavaScript files uses: liri-infra/qmllint-action@master env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: SQL Check uses: yokawasa/action-sqlcheck@v1.3.0 id: sqlcheck @@ -166,18 +137,15 @@ jobs: schema directories: | src/models - - name: Get SQL CHECK output if: steps.sqlcheck.outputs.issue-found run: echo "Issues found in previous step" - - name: Clang Format uses: DoozyX/clang-format-lint-action@v0.13 with: source: './src' clangFormatVersion: 12 inplace: True - - uses: EndBug/add-and-commit@v9 with: author_name: Clang Robot @@ -186,24 +154,24 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # - name: PMD Code Analyzer Action - # uses: billyan2018/setup-pmd@PMDAnalyzer1.0 - # run: pmd -d ./src -R category/apex/design.xml -f text - - # - name: Check_for_duplicate_code - # uses: platisd/duplicate-code-detection-tool@master - # with: - # github_token: ${{ secrets.GITHUB_TOKEN }} - # directories: 'src' - # # Ignore the specified directories - # ignore_directories: 'src/3rd-party' - # # Only examine .h and .cpp files - # file_extensions: 'h, cpp' - # # Only report similarities above 5% - # ignore_below: 5 - # # If a file is more than 70% similar to another, then the job fails - # fail_above: 70 - # # If a file is more than 15% similar to another, show a warning symbol in the report - # warn_above: 15 - # # Remove `src/` from the file paths when reporting similarities - # project_root_dir: 'src' +# - name: PMD Code Analyzer Action +# uses: billyan2018/setup-pmd@PMDAnalyzer1.0 +# run: pmd -d ./src -R category/apex/design.xml -f text + +# - name: Check_for_duplicate_code +# uses: platisd/duplicate-code-detection-tool@master +# with: +# github_token: ${{ secrets.GITHUB_TOKEN }} +# directories: 'src' +# # Ignore the specified directories +# ignore_directories: 'src/3rd-party' +# # Only examine .h and .cpp files +# file_extensions: 'h, cpp' +# # Only report similarities above 5% +# ignore_below: 5 +# # If a file is more than 70% similar to another, then the job fails +# fail_above: 70 +# # If a file is more than 15% similar to another, show a warning symbol in the report +# warn_above: 15 +# # Remove `src/` from the file paths when reporting similarities +# project_root_dir: 'src'