diff --git a/.clang-tidy b/.clang-tidy new file mode 100644 index 0000000..31bccee --- /dev/null +++ b/.clang-tidy @@ -0,0 +1,24 @@ +--- +# clang-analyzer-cplusplus.NewDeleteLeaks reports QObjects owned by their parent as leaks +Checks: > + -*, + bugprone-*, + -bugprone-easily-swappable-parameters, + -bugprone-narrowing-conversions, + -bugprone-exception-escape, + clang-analyzer-*, + -clang-analyzer-cplusplus.NewDeleteLeaks, + cppcoreguidelines-slicing, + cppcoreguidelines-virtual-class-destructor, + misc-redundant-expression, + misc-unused-using-decls, + modernize-use-nullptr, + modernize-use-override, + performance-*, + -performance-enum-size, + readability-misleading-indentation, + readability-redundant-smartptr-get +WarningsAsErrors: '' +HeaderFilterRegex: '/(app|modules)/' +FormatStyle: file +... diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index d5216c1..c2e2a01 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -18,7 +18,7 @@ on: branches: [ "master" ] env: - QT_VERSION: '6.10.2' + QT_VERSION: '6.12.0' QT_MODULES: 'qtmultimedia qtwebsockets qtimageformats' jobs: @@ -73,20 +73,17 @@ jobs: # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL - uses: github/codeql-action/init@v3 + uses: github/codeql-action/init@v4 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. - - # For more 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 + build-mode: manual + # The default suite only runs high-precision security queries + queries: security-and-quality # Autobuild attempts to build any compiled languages (C/C++, C#, Go, Java, or Swift). # If this step fails, then you should remove it and run the build manually (see below) # - name: Autobuild - # uses: github/codeql-action/autobuild@v2 + # uses: github/codeql-action/autobuild@v4 - name: Build the application run: | @@ -108,6 +105,6 @@ jobs: # ./location_of_script_within_repo/buildscript.sh - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v3 + uses: github/codeql-action/analyze@v4 with: category: "/language:${{matrix.language}}" diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 766955a..df4017a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -4,15 +4,18 @@ on: push: branches: - '**' + tags: + - 'v*' pull_request: # The branches below must be a subset of the branches above branches: [ "master" ] - create: env: - QT_VERSION: '6.10.2' + QT_VERSION: '6.12.0' QT_MODULES: 'qtmultimedia qtwebsockets qtimageformats' - EM_VERSION: '4.0.7' + EM_VERSION: '5.0.5' + # Has to match the NDK the Qt for Android binaries are built with + ANDROID_NDK_VERSION: '27.2.12479018' permissions: contents: write @@ -90,20 +93,20 @@ jobs: export CPM_SOURCE_CACHE=~/cpm-cache IMGUR_API_KEY=${{ secrets.IMGUR_API_KEY }} bash ./dist/ios/build.sh - name: Upload artifacts to GitHub - if: github.event_name != 'create' + if: github.ref_type != 'tag' uses: actions/upload-artifact@v4 with: name: Lith.ipa path: build_ios/Lith.ipa - name: Upload to GitHub - if: github.event_name == 'create' + if: github.ref_type == 'tag' run: | export VERSION_NAME=$(./dist/get-version-name.sh) if [[ "$VERSION_NAME" != "" ]]; then ./dist/upload-github-release-asset.sh github_api_token="${{ secrets.GITHUB_TOKEN }}" tag="v${VERSION_NAME}" filename="build_ios/Lith.ipa" renameto="Lith-iOS-${VERSION_NAME}.ipa" fi - name: Upload to Testflight - if: github.event_name == 'create' + if: github.ref_type == 'tag' run: | export VERSION_NAME=$(./dist/get-version-name.sh) if [[ "$VERSION_NAME" != "" ]]; then @@ -136,11 +139,20 @@ jobs: modules: ${{env.QT_MODULES}} cache: true cache-key-prefix: ${{ github.job }}-qt-${{ env.QT_VERSION }} + - name: Install Qt for arm64-v8a + uses: jurplel/install-qt-action@v4 + with: + version: ${{env.QT_VERSION}} + target: android + arch: android_arm64_v8a + set-env: false + modules: ${{env.QT_MODULES}} + cache: true + cache-key-prefix: ${{ github.job }}-qt-cross-arm64-${{ env.QT_VERSION }} - name: Install Qt uses: jurplel/install-qt-action@v4 with: version: ${{env.QT_VERSION}} - host: linux target: android arch: android_armv7 modules: ${{env.QT_MODULES}} @@ -150,23 +162,31 @@ jobs: - name: Get OpenSSL run: | git clone https://github.com/KDAB/android_openssl.git --depth=1 + - name: Install the Android NDK + run: | + yes | "${ANDROID_SDK_ROOT}/cmdline-tools/latest/bin/sdkmanager" --install "ndk;${ANDROID_NDK_VERSION}" > /dev/null + - name: Set up JDK + uses: actions/setup-java@v4 + with: + distribution: temurin + java-version: '21' - name: Build the Android binary run: | export ANDROID_SDK=${ANDROID_SDK_ROOT} export CPM_SOURCE_CACHE=~/cpm-cache export ANDROID_OPENSSL_PATH="$PWD/android_openssl/ssl_3" - export ANDROID_NDK="${ANDROID_NDK_LATEST_HOME}" - export ANDROID_NDK_HOME="${ANDROID_NDK_LATEST_HOME}" - export ANDROID_NDK_ROOT="${ANDROID_NDK_LATEST_HOME}" + export ANDROID_NDK="${ANDROID_SDK_ROOT}/ndk/${ANDROID_NDK_VERSION}" + export ANDROID_NDK_HOME="${ANDROID_NDK}" + export ANDROID_NDK_ROOT="${ANDROID_NDK}" IMGUR_API_KEY=${{ secrets.IMGUR_API_KEY }} bash ./dist/android/build.sh - name: Upload artifacts to GitHub - if: github.event_name != 'create' + if: github.ref_type != 'tag' uses: actions/upload-artifact@v4 with: name: android-build-debug.apk path: build_android/app/android-build/Lith.apk - name: Upload to GitHub - if: github.event_name == 'create' + if: github.ref_type == 'tag' run: | VERSION_NAME=$(./dist/get-version-name.sh) if [[ "$VERSION_NAME" != "" ]]; then @@ -198,6 +218,7 @@ jobs: cache-key-prefix: ${{ github.job }}-qt-${{ env.QT_VERSION }} - name: Install Qt + id: install-qt-wasm uses: jurplel/install-qt-action@v4 with: version: ${{env.QT_VERSION}} @@ -215,8 +236,7 @@ jobs: - name: Build the Emscripten binary run: | - #hack - export QT_ROOT_DIR=${QT_ROOT_DIR}/../wasm_multithread + export QT_ROOT_DIR="${{ steps.install-qt-wasm.outputs.qt-root-dir }}" IMGUR_API_KEY=${{ secrets.IMGUR_API_KEY }} bash ./dist/wasm/build.sh # inject CORS handling into the main page sed s'/\(<\/title>\)/\0\n