Merge pull request #428 from DioEgizio/fixes-to-CI

This commit is contained in:
flow 2022-11-14 14:16:01 -08:00 committed by GitHub
commit cedc7754d9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 47 additions and 23 deletions

View File

@ -7,6 +7,10 @@ on:
description: Type of build (Debug, Release, RelWithDebInfo, MinSizeRel) description: Type of build (Debug, Release, RelWithDebInfo, MinSizeRel)
type: string type: string
default: Debug default: Debug
is_qt_cached:
description: Enable Qt caching or not
type: string
default: true
secrets: secrets:
SPARKLE_ED25519_KEY: SPARKLE_ED25519_KEY:
description: Private key for signing Sparkle updates description: Private key for signing Sparkle updates
@ -102,14 +106,6 @@ jobs:
with: with:
submodules: 'true' submodules: 'true'
- name: Initialize CodeQL
if: runner.os == 'Linux' && matrix.qt_ver == 6
uses: github/codeql-action/init@v2
with:
config-file: ./.github/codeql/codeql-config.yml
queries: security-and-quality
languages: cpp, java
- name: 'Setup MSYS2' - name: 'Setup MSYS2'
if: runner.os == 'Windows' && matrix.msystem != '' if: runner.os == 'Windows' && matrix.msystem != ''
uses: msys2/setup-msys2@v2 uses: msys2/setup-msys2@v2
@ -200,8 +196,7 @@ jobs:
arch: ${{ matrix.qt_arch }} arch: ${{ matrix.qt_arch }}
modules: ${{ matrix.qt_modules }} modules: ${{ matrix.qt_modules }}
tools: ${{ matrix.qt_tools }} tools: ${{ matrix.qt_tools }}
cache: true cache: ${{ inputs.is_qt_cached }}
cache-key-prefix: ${{ matrix.qt_host }}-${{ matrix.qt_version }}-"${{ matrix.qt_modules }}"-qt_cache
- name: Prepare AppImage (Linux) - name: Prepare AppImage (Linux)
if: runner.os == 'Linux' && matrix.qt_ver != 5 if: runner.os == 'Linux' && matrix.qt_ver != 5
@ -292,14 +287,6 @@ jobs:
run: | run: |
ctest -E "^example64|example$" --test-dir build --output-on-failure -C ${{ inputs.build_type }} ctest -E "^example64|example$" --test-dir build --output-on-failure -C ${{ inputs.build_type }}
##
# CODE SCAN
##
- name: Perform CodeQL Analysis
if: runner.os == 'Linux' && matrix.qt_ver == 6
uses: github/codeql-action/analyze@v2
## ##
# PACKAGE BUILDS # PACKAGE BUILDS
## ##
@ -510,10 +497,10 @@ jobs:
echo "VERSION=$ver_short" >> $GITHUB_ENV echo "VERSION=$ver_short" >> $GITHUB_ENV
- name: Package Snap (Linux) - name: Package Snap (Linux)
id: snapcraft id: snapcraft
if: runner.os == 'Linux' && matrix.qt_ver != 5 if: runner.os == 'Linux' && inputs.build_type == 'Debug'
uses: snapcore/action-build@v1 uses: snapcore/action-build@v1
- name: Upload Snap (Linux) - name: Upload Snap (Linux)
if: runner.os == 'Linux' && matrix.qt_ver != 5 if: runner.os == 'Linux' && inputs.build_type == 'Debug'
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v3
with: with:
name: prismlauncher_${{ env.VERSION }}_amd64.snap name: prismlauncher_${{ env.VERSION }}_amd64.snap

35
.github/workflows/codeql.yml vendored Normal file
View File

@ -0,0 +1,35 @@
name: "CodeQL Code Scanning"
on: [ push, pull_request, workflow_dispatch ]
jobs:
CodeQL:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
submodules: 'true'
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
config-file: ./.github/codeql/codeql-config.yml
queries: security-and-quality
languages: cpp, java
- name: Install Dependencies
run:
sudo apt-get -y update
sudo apt-get -y install ninja-build extra-cmake-modules scdoc qtbase5-dev qtchooser qt5-qmake qtbase5-dev-tools libqt5core5a libqt5network5 libqt5gui5
- name: Configure and Build
run: |
cmake -S . -B build -DCMAKE_INSTALL_PREFIX=/usr -DLauncher_QT_VERSION_MAJOR=5 -G Ninja
cmake --build build
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2

View File

@ -30,5 +30,6 @@ jobs:
uses: ./.github/workflows/build.yml uses: ./.github/workflows/build.yml
with: with:
build_type: Debug build_type: Debug
is_qt_cached: true
secrets: secrets:
SPARKLE_ED25519_KEY: ${{ secrets.SPARKLE_ED25519_KEY }} SPARKLE_ED25519_KEY: ${{ secrets.SPARKLE_ED25519_KEY }}

View File

@ -12,6 +12,7 @@ jobs:
uses: ./.github/workflows/build.yml uses: ./.github/workflows/build.yml
with: with:
build_type: Release build_type: Release
is_qt_cached: false
secrets: secrets:
SPARKLE_ED25519_KEY: ${{ secrets.SPARKLE_ED25519_KEY }} SPARKLE_ED25519_KEY: ${{ secrets.SPARKLE_ED25519_KEY }}

View File

@ -121,7 +121,7 @@ ModDetails ReadMCModTOML(QByteArray contents)
return {}; return {};
} }
auto modsTable = tomlModsTable0->as_table(); auto modsTable = tomlModsTable0->as_table();
if (!tomlModsTable0) { if (!modsTable) {
qWarning() << "Corrupted mods.toml? [[mods]] was not a table!"; qWarning() << "Corrupted mods.toml? [[mods]] was not a table!";
return {}; return {};
} }

View File

@ -262,7 +262,7 @@ void ModPage::openUrl(const QUrl& url)
const QString address = url.host() + url.path(); const QString address = url.host() + url.path();
QRegularExpressionMatch match; QRegularExpressionMatch match;
const char* page; QString page;
match = modrinth.match(address); match = modrinth.match(address);
if (match.hasMatch()) if (match.hasMatch())
@ -276,7 +276,7 @@ void ModPage::openUrl(const QUrl& url)
page = "curseforge"; page = "curseforge";
} }
if (match.hasMatch()) { if (!page.isNull()) {
const QString slug = match.captured(1); const QString slug = match.captured(1);
// ensure the user isn't opening the same mod // ensure the user isn't opening the same mod