From f448c6ec3d97af8b7fae5161efe4e31996c40a05 Mon Sep 17 00:00:00 2001 From: Benjamin O Date: Mon, 16 Mar 2020 12:39:36 -0400 Subject: [PATCH 1/5] Change environment variable to Qt5_DIR --- .github/workflows/test.yml | 4 ++-- README.md | 8 ++++---- src/main.ts | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ea9f3e15..112ee4d8 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -31,7 +31,7 @@ jobs: run: | cd tests/TestWithModules call "%programfiles(x86)%\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat" - dir %Qt5_Dir%/lib/cmake + dir %Qt5_DIR%/lib/cmake qmake shell: cmd @@ -39,6 +39,6 @@ jobs: if: (!startsWith(matrix.os, 'windows')) run: | cd tests/TestWithModules - ls $Qt5_Dir/lib/cmake + ls $Qt5_DIR/lib/cmake qmake shell: bash diff --git a/README.md b/README.md index caad22a7..a0b18d84 100644 --- a/README.md +++ b/README.md @@ -55,9 +55,9 @@ Android: `android_armv7` ### `dir` This is the directory prefix that Qt will be installed to. -For example, if you set dir to `/example/`, your bin folder will be located at `/example/Qt/5.12.7/(your_arch)/bin`. When possible, access your Qt directory through the `Qt5_Dir` environment variable. +For example, if you set dir to `${{ github.workspace }}/example/`, your bin folder will be located at `$GITHUB_WORKSPACE/example/Qt/5.12.7/(your_arch)/bin`. When possible, access your Qt directory through the `Qt5_DIR` environment variable. -Default: `${RUNNER_WORKSPACE}` (this is one folder above the starting directory) +Default: `$HOME` (this is one folder above the starting directory) ### `install-deps` Whether or not to automatically install Qt dependencies on Linux (you probably want to leave this on). @@ -120,7 +120,7 @@ Default: `==0.6b8` host: 'windows' target: 'desktop' arch: 'win64_msvc2017_64' - dir: '/example/' + dir: '${{ github.workspace }}/example/' install-deps: 'true' modules: 'qtcharts qtwebengine' mirror: 'http://mirrors.ocf.berkeley.edu/qt/' @@ -131,7 +131,7 @@ Default: `==0.6b8` ## More info -The Qt bin directory is added to your `path` environment variable. `Qt5_Dir` is also set appropriately for cmake. +The Qt bin directory is added to your `path` environment variable. `Qt5_DIR` is also set appropriately for cmake. Big thanks to the [aqtinstall](https://github.com/miurahr/aqtinstall/) developers for making this easy. Please go support them, they did all of the hard work here. diff --git a/src/main.ts b/src/main.ts index 3cb5702d..ae39f01f 100644 --- a/src/main.ts +++ b/src/main.ts @@ -5,7 +5,7 @@ import * as exec from '@actions/exec'; async function run() { try { - const dir = (core.getInput("dir") || process.env.RUNNER_WORKSPACE) + "/Qt"; + const dir = (core.getInput("dir") || process.env.HOME) + "/Qt"; const version = core.getInput("version"); // Qt installer assumes basic requirements that are not installed by @@ -87,7 +87,7 @@ async function run() { let qtPath = dir + "/" + version; qtPath = glob.sync(qtPath + '/**/*')[0]; - core.exportVariable('Qt5_Dir', qtPath); + core.exportVariable('Qt5_DIR', qtPath); core.addPath(qtPath + "/bin"); } catch (error) { core.setFailed(error.message); From 728845e0aaa95bc9e07144b98477f83724b4a093 Mon Sep 17 00:00:00 2001 From: Benjamin O Date: Mon, 16 Mar 2020 12:53:08 -0400 Subject: [PATCH 2/5] attempt reverting default dir to fix windows not passing test --- src/main.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.ts b/src/main.ts index ae39f01f..3136cc28 100644 --- a/src/main.ts +++ b/src/main.ts @@ -5,7 +5,7 @@ import * as exec from '@actions/exec'; async function run() { try { - const dir = (core.getInput("dir") || process.env.HOME) + "/Qt"; + const dir = (core.getInput("dir") || process.env.RUNNER_WORKSPACE) + "/Qt"; const version = core.getInput("version"); // Qt installer assumes basic requirements that are not installed by From 28172f4aaf1f8dafc57ef336f878e020cbf011e2 Mon Sep 17 00:00:00 2001 From: Benjamin O Date: Mon, 16 Mar 2020 13:03:17 -0400 Subject: [PATCH 3/5] test using env var as dir --- .github/workflows/test.yml | 1 + README.md | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 112ee4d8..50818668 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -25,6 +25,7 @@ jobs: uses: ./ with: modules: 'qtcharts qtwebengine' + dir: '${{ github.workspace }}' - name: Configure test project on windows if: startsWith(matrix.os, 'windows') diff --git a/README.md b/README.md index a0b18d84..7d6ee8d8 100644 --- a/README.md +++ b/README.md @@ -57,7 +57,7 @@ This is the directory prefix that Qt will be installed to. For example, if you set dir to `${{ github.workspace }}/example/`, your bin folder will be located at `$GITHUB_WORKSPACE/example/Qt/5.12.7/(your_arch)/bin`. When possible, access your Qt directory through the `Qt5_DIR` environment variable. -Default: `$HOME` (this is one folder above the starting directory) +Default: `$RUNNER_WORKSPACE` (this is one folder above the starting directory) ### `install-deps` Whether or not to automatically install Qt dependencies on Linux (you probably want to leave this on). From 35251552541542251d6b7f40d7c3c49dd8e4214d Mon Sep 17 00:00:00 2001 From: Benjamin O Date: Mon, 16 Mar 2020 13:06:52 -0400 Subject: [PATCH 4/5] add back legacy variable --- src/main.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main.ts b/src/main.ts index 3136cc28..2da4bb74 100644 --- a/src/main.ts +++ b/src/main.ts @@ -87,6 +87,7 @@ async function run() { let qtPath = dir + "/" + version; qtPath = glob.sync(qtPath + '/**/*')[0]; + core.exportVariable('Qt5_Dir', qtPath); // Incorrect name that was fixed, but kept around so it doesn't break anything core.exportVariable('Qt5_DIR', qtPath); core.addPath(qtPath + "/bin"); } catch (error) { From 46e4fe73acc3899ccabcad5b704ec8f37f4d0d92 Mon Sep 17 00:00:00 2001 From: Benjamin O Date: Mon, 16 Mar 2020 13:12:45 -0400 Subject: [PATCH 5/5] remove dir from workflow --- .github/workflows/test.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 50818668..112ee4d8 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -25,7 +25,6 @@ jobs: uses: ./ with: modules: 'qtcharts qtwebengine' - dir: '${{ github.workspace }}' - name: Configure test project on windows if: startsWith(matrix.os, 'windows')