Skip to content

Commit

Permalink
Merge branch 'master' into not-ready-v4-not-ready
Browse files Browse the repository at this point in the history
  • Loading branch information
jurplel committed Feb 6, 2024
2 parents 51b9abd + 9acccda commit e22b1e0
Show file tree
Hide file tree
Showing 9 changed files with 133 additions and 100 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
48 changes: 34 additions & 14 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 Down Expand Up @@ -51,6 +51,7 @@ jobs:
# In Qt 6.2.0+, qtwebengine requires qtpositioning and qtwebchannel
modules: qtwebengine qtpositioning qtwebchannel
- tools-only-build: true
add-tools-to-path: true
cache:
- cached
- uncached
Expand Down Expand Up @@ -81,14 +82,18 @@ jobs:
version: "5.15.2"
requested: "5.15"
modules: qtwebengine
- os: ubuntu-22.04
qt:
tools-only-build: true
add-tools-to-path: false


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 @@ -189,19 +194,34 @@ jobs:
with:
tools-only: true
tools: tools_ifw tools_qtcreator,qt.tools.qtcreator
add-tools-to-path: ${{ matrix.qt.add-tools-to-path }}
cache: ${{ matrix.cache == 'cached' }}

- name: Test installed tools
if: ${{ matrix.qt.tools-only-build }}
env:
# Conditionally set qtcreator path based on os:
QTCREATOR_BIN_PATH: ${{ startsWith(matrix.os, 'macos') && '../Qt/Qt Creator.app/Contents/MacOS/' || '../Qt/Tools/QtCreator/bin/' }}
if: ${{ matrix.qt.tools-only-build && matrix.qt.add-tools-to-path }}
shell: bash
run: |
echo "Path: ${PATH}"
# Check if QtIFW is installed
ls ../Qt/Tools/QtInstallerFramework/*/bin/
../Qt/Tools/QtInstallerFramework/*/bin/archivegen --version
which archivegen
archivegen --version
# Check if QtCreator is installed: QtCreator includes the CLI program 'qbs' on all 3 platforms
ls "${QTCREATOR_BIN_PATH}"
"${QTCREATOR_BIN_PATH}qbs" --version
which qbs
qbs --version

- name: Test that installed tools are not in the path
if: ${{ matrix.qt.tools-only-build && !matrix.qt.add-tools-to-path }}
shell: bash
run: |
echo "Path: ${PATH}"
# Check that QtIFW has been installed
ls ../Qt/Tools/QtInstallerFramework/*/bin/ | grep archivegen
# Check that QtIFW is not in the path
! which archivegen
! archivegen --version
# Check that qbs (from QtCreator) is not in the path
! which qbs
! qbs --version
21 changes: 21 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,22 @@ For example, this value will install the most recent versions of QtIFW and QtCre

You can find a full list of tools easily by using [this awesome website](https://ddalcino.github.io/aqt-list-server/).

### `add-tools-to-path`

When set to `true`, and the `tools` parameter is non-empty,
the following paths will be prepended to the `PATH` variable:
* `Tools/**/bin`
* `*.app/Contents/MacOS`
* `*.app/**/bin`

Most tools end up in the `Tools` folder, and have a `bin` directory containing CLI tools.
On MacOS, several tools are packaged in `.app` bundles, and CLI tools are spread out among various `bin` folders
and the `Contents/MacOS` folder.

Distinct from, and not affected by, the `set-env` parameter.

Default: `true`

### `source`

Set this to `true` to install Qt source code. Incompatible with `aqtinstall < 2.0.4`.
Expand Down Expand Up @@ -200,6 +216,7 @@ Default: none

### `set-env`
Set this to false if you want to avoid setting environment variables for whatever reason.
Has no effect on `tools` paths; to modify these you must use `add-tools-to-path`.

Default: `true`

Expand Down Expand Up @@ -261,6 +278,10 @@ Example value: `--external 7z`
## More info
For more in-depth and certifiably up-to-date documentation, check the documentation for aqtinstall [here](https://aqtinstall.readthedocs.io/en/latest/getting_started.html).

Any tools you installed with the `tools` key will be added to the beginning of your `PATH` environment variable.
Specifically, any `bin` directories within the tool's directory will be added.
On MacOS, if the tool is an app bundle, then the `.app/Contents/MacOS` folder will also be added to your `PATH`.

The Qt bin directory is appended to your `path` environment variable.
`Qt5_DIR` is also set appropriately for CMake if you are using Qt 5.
In addition, `QT_PLUGIN_PATH`, `QML2_IMPORT_PATH`, `PKG_CONFIG_PATH` and `LD_LIBRARY_PATH` are set accordingly. `IQTA_TOOLS` is set to the "Tools" directory if tools are installed as well.
Expand Down
8 changes: 8 additions & 0 deletions README_upgrade_guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,14 @@
If your action uses this variable for any other purpose, you should update it to use `QT_ROOT_DIR` instead.
* Removed the `Qt5_Dir` and `Qt6_DIR` environment variables, because they are not used by CMake.
If your action uses these variables, you should update them to use `QT_ROOT_DIR` instead.
* Any tools you installed with the `tools` key will be added to the beginning of your `PATH` environment variable.
Specifically, any `bin` directories within the tool's directory will be added.
On MacOS, if the tool is an app bundle, then the `.app/Contents/MacOS` folder will also be added to your `PATH`.
* You should take care to investigate the order of the new `PATH` variable to make sure that the tools you are using
are not clobbered by tools in some other path. You may need to rearrange the order of your workflow steps, so that
any clobbered tools are added to the path later than the ones added by this action.
* If the added tool paths are still causing trouble, you can remove them from the `PATH` by setting
`add-tools-to-path: false`.

## v3
* Updated `aqtinstall` to version 2.1.* by default.
Expand Down
6 changes: 5 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ inputs:
--
specify comma-separated argument lists which are themselves separated by spaces:
<tool_name>,<tool_version>,<tool_arch>
add-tools-to-path:
default: true
description: When true, prepends directories of tools to PATH environment variable.
set-env:
default: true
description: Whether or not to set environment variables after running aqtinstall
Expand Down Expand Up @@ -80,7 +83,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 @@ -98,6 +101,7 @@ runs:
cache: ${{ inputs.cache }}
cache-key-prefix: ${{ inputs.cache-key-prefix }}
tools: ${{ inputs.tools }}
add-tools-to-path: ${{ inputs.add-tools-to-path }}
set-env: ${{ inputs.set-env }}
no-qt-binaries: ${{ inputs.no-qt-binaries }}
tools-only: ${{ inputs.tools-only }}
Expand Down
5 changes: 4 additions & 1 deletion action/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ inputs:
--
specify comma-separated argument lists which are themselves separated by spaces:
<tool_name>,<tool_version>,<tool_arch>
add-tools-to-path:
default: true
description: When true, prepends directories of tools to PATH environment variable.
set-env:
default: true
description: Whether or not to set environment variables after running aqtinstall
Expand Down Expand Up @@ -73,5 +76,5 @@ inputs:
example-modules:
description: Space-separated list of additional example modules to install.
runs:
using: node16
using: node20
main: lib/main.js
Loading

0 comments on commit e22b1e0

Please sign in to comment.