Skip to content

Commit

Permalink
merge
Browse files Browse the repository at this point in the history
  • Loading branch information
jurplel committed May 19, 2024
2 parents d39ffb1 + 0817f95 commit 00038d9
Show file tree
Hide file tree
Showing 9 changed files with 76 additions and 24 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/test-android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ jobs:
example-modules: qtsensors

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version: 16
node-version: 20
cache: npm
cache-dependency-path: action/

Expand Down
32 changes: 25 additions & 7 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version: 16
node-version: 20
cache: npm
cache-dependency-path: action/

Expand All @@ -33,8 +33,9 @@ jobs:
- ubuntu-20.04
- windows-2022
- windows-2019
- macos-11
- macos-12
- macos-13
- macos-14
aqtversion:
- null # use whatever the default is
src-doc-examples:
Expand All @@ -50,6 +51,9 @@ jobs:
requested: "6.3.*"
# In Qt 6.2.0+, qtwebengine requires qtpositioning and qtwebchannel
modules: qtwebengine qtpositioning qtwebchannel
- version: "6.7.0"
requested: "6.7.0"
modules: qtwebengine qtpositioning qtwebchannel
- tools-only-build: true
add-tools-to-path: true
cache:
Expand Down Expand Up @@ -89,11 +93,11 @@ jobs:


steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version: 16
node-version: 20
cache: npm
cache-dependency-path: action/

Expand Down Expand Up @@ -125,6 +129,20 @@ jobs:
tools: tools_ifw tools_qtcreator,qt.tools.qtcreator
cache: ${{ matrix.cache == 'cached' }}

- name: Switch macOS Xcode version with older Qt versions
if: ${{ matrix.qt.version && (startsWith(matrix.os, 'macos-13') || startsWith(matrix.os, 'macos-14')) }}
shell: pwsh
env:
QT_VERSION: ${{ matrix.qt.version }}
run: |
if ([version]$env:QT_VERSION -ge [version]"6.5.3") {
# GitHub macOS 13/14 runners use Xcode 15.0.x by default which has a known linker issue causing crashes if the artifact is run on macOS <= 12
sudo xcode-select --switch /Applications/Xcode_15.2.app
} else {
# Keep older Qt versions on Xcode 14 due to concern over QTBUG-117484
sudo xcode-select --switch /Applications/Xcode_14.3.1.app
}
- name: Configure test project on windows
if: ${{ matrix.qt.version && startsWith(matrix.os, 'windows') }}
env:
Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,12 @@ If you set either `no-qt-binaries` or `tools-only` to `true`, you will skip inst

Default: `false`

### `aqtsource`

The full specifier for a version of [aqtinstall](https://github.com/miurahr/aqtinstall) as passed to pip. For example: `git+https://github.com/miurahr/aqtinstall.git`. This is intended to be used to troubleshoot any bugs that might be caused or fixed by certain versions of aqtinstall. Note that when this is used, the value of `aqtversion` is ignored.

By default this is unset and ignored.

### `aqtversion`

Version of [aqtinstall](https://github.com/miurahr/aqtinstall) to use, given in the format used by pip, for example: `==0.7.1`, `>=0.7.1`, `==0.7.*`. This is intended to be used to troubleshoot any bugs that might be caused or fixed by certain versions of aqtinstall.
Expand Down
5 changes: 4 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ inputs:
tools-only:
description: Synonym for `no-qt-binaries`, used for backwards compatibility.
default: false
aqtsource:
description: Location to source aqtinstall from in case of issues
aqtversion:
description: Version of aqtinstall to use in case of issues
default: ==3.1.*
Expand Down Expand Up @@ -83,7 +85,7 @@ runs:
steps:
- name: Setup Python
if: ${{ inputs.setup-python == 'true' }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.6.x - 3.11.x'

Expand All @@ -105,6 +107,7 @@ runs:
set-env: ${{ inputs.set-env }}
no-qt-binaries: ${{ inputs.no-qt-binaries }}
tools-only: ${{ inputs.tools-only }}
aqtsource: ${{ inputs.aqtsource }}
aqtversion: ${{ inputs.aqtversion }}
py7zrversion: ${{ inputs.py7zrversion }}
source: ${{ inputs.source }}
Expand Down
2 changes: 1 addition & 1 deletion action/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ module.exports = {
"@typescript-eslint/no-floating-promises": "error",
"@typescript-eslint/no-invalid-this": "error",
"@typescript-eslint/no-loop-func": "error",
"@typescript-eslint/no-magic-numbers": ["error", { ignoreArrayIndexes: true }],
"@typescript-eslint/no-magic-numbers": ["error", { ignoreArrayIndexes: true, ignore: [0, 1] }],
"@typescript-eslint/no-redeclare": "error",
"@typescript-eslint/no-require-imports": "error",
"@typescript-eslint/no-restricted-imports": "error",
Expand Down
4 changes: 3 additions & 1 deletion action/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ inputs:
tools-only:
description: Synonym for `no-qt-binaries`, used for backwards compatibility.
default: false
aqtsource:
description: Location to source aqtinstall from in case of issues
aqtversion:
description: Version of aqtinstall to use in case of issues
default: ==3.1.*
Expand Down Expand Up @@ -76,5 +78,5 @@ inputs:
example-modules:
description: Space-separated list of additional example modules to install.
runs:
using: node16
using: node20
main: lib/main.js
2 changes: 1 addition & 1 deletion action/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"license": "MIT",
"dependencies": {
"@actions/cache": "^3.0.0",
"@actions/core": "^1.9.1",
"@actions/core": "^1.10.1",
"@actions/exec": "^1.1.0",
"compare-versions": "^3.6.0",
"glob": "^7.0.0"
Expand Down
39 changes: 29 additions & 10 deletions action/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ class Inputs {
readonly isInstallQtBinaries: boolean;
readonly setEnv: boolean;

readonly aqtSource: string;
readonly aqtVersion: string;
readonly py7zrVersion: string;

Expand Down Expand Up @@ -210,6 +211,7 @@ class Inputs {

this.setEnv = Inputs.getBoolInput("set-env");

this.aqtSource = core.getInput("aqtsource");
this.aqtVersion = core.getInput("aqtversion");

this.py7zrVersion = core.getInput("py7zrversion");
Expand Down Expand Up @@ -237,6 +239,7 @@ class Inputs {
this.version,
this.dir,
this.py7zrVersion,
this.aqtSource,
this.aqtVersion,
],
this.modules,
Expand Down Expand Up @@ -308,9 +311,16 @@ const run = async (): Promise<void> => {
"libxkbcommon-dev",
"libxkbcommon-x11-0",
"libxcb-xkb-dev",
].join(" ");
];

// Qt 6.5.0 adds this requirement:
// https://code.qt.io/cgit/qt/qtreleasenotes.git/about/qt/6.5.0/release-note.md
if (compareVersions(inputs.version, ">=", "6.5.0")) {
dependencies.push("libxcb-cursor0");
}

const updateCommand = "apt-get update";
const installCommand = `apt-get install ${dependencies} -y`;
const installCommand = `apt-get install ${dependencies.join(" ")} -y`;
if (inputs.installDeps === "nosudo") {
await exec(updateCommand);
await exec(installCommand);
Expand Down Expand Up @@ -344,7 +354,11 @@ const run = async (): Promise<void> => {
await execPython("pip install", ["setuptools", "wheel", `"py7zr${inputs.py7zrVersion}"`]);

// Install aqtinstall separately: allows aqtinstall to override py7zr if required
await execPython("pip install", [`"aqtinstall${inputs.aqtVersion}"`]);
if (inputs.aqtSource.length > 0) {
await execPython("pip install", [`"${inputs.aqtSource}"`]);
} else {
await execPython("pip install", [`"aqtinstall${inputs.aqtVersion}"`]);
}

// This flag will install a parallel desktop version of Qt, only where required.
// aqtinstall will automatically determine if this is necessary.
Expand Down Expand Up @@ -415,13 +429,18 @@ const run = async (): Promise<void> => {
toolsPaths(inputs.dir).map(nativePath).forEach(core.addPath);
}

// Set environment variables
if (inputs.setEnv) {
if (inputs.tools.length) {
core.exportVariable("IQTA_TOOLS", nativePath(`${inputs.dir}/Tools`));
}
if (inputs.isInstallQtBinaries) {
const qtPath = nativePath(locateQtArchDir(inputs.dir));
// Set environment variables/outputs for tools
if (inputs.tools.length && inputs.setEnv) {
core.exportVariable("IQTA_TOOLS", nativePath(`${inputs.dir}/Tools`));
}
// Set environment variables/outputs for binaries
if (inputs.isInstallQtBinaries) {
const qtPath = nativePath(locateQtArchDir(inputs.dir));
// Set outputs
core.setOutput("qtPath", qtPath);

// Set env variables
if (inputs.setEnv) {
if (process.platform === "linux") {
setOrAppendEnvVar("LD_LIBRARY_PATH", nativePath(`${qtPath}/lib`));
}
Expand Down
4 changes: 4 additions & 0 deletions tests/TestWithModules/TestWithModules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ QT += webenginewidgets
CONFIG += c++11 console
CONFIG -= app_bundle

# Xcode 15 fix
# https://crystalidea.com/blog/qt-apps-crash-when-using-xcode-15
LIBS += -Wl,-ld_classic

# The following define makes your compiler emit warnings if you use
# any Qt feature that has been marked deprecated (the exact warnings
# depend on your compiler). Please consult the documentation of the
Expand Down

0 comments on commit 00038d9

Please sign in to comment.