From ec9225c9124c40439ab46d54b7faf54cc0052514 Mon Sep 17 00:00:00 2001 From: Jeremy Tuloup Date: Fri, 5 Jun 2020 16:13:31 +0200 Subject: [PATCH 01/17] Test activate on windows --- .github/workflows/test.yml | 2 +- dist/index.js | 9 +++++++++ src/main.ts | 9 +++++++++ 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 702af62..9df9790 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -21,7 +21,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-latest, macos-latest] + os: [ubuntu-latest, macos-latest, windows-latest] steps: - uses: actions/checkout@v2 diff --git a/dist/index.js b/dist/index.js index b0510f2..bd996d7 100644 --- a/dist/index.js +++ b/dist/index.js @@ -1021,6 +1021,13 @@ function installMamba() { yield exec.exec('conda', ['install', '-y', '-c', 'conda-forge', 'mamba']); }); } +function activate(os) { + return __awaiter(this, void 0, void 0, function* () { + if (os === 'win32') { + yield exec.exec('activate.bat', ['base']); + } + }); +} function run() { return __awaiter(this, void 0, void 0, function* () { try { @@ -1029,6 +1036,8 @@ function run() { fixPermissions(os); core.debug('Add conda to the path'); yield addPath(os); + core.debug('Activate the environment'); + activate(os); core.debug('Installing mamba'); yield installMamba(); } diff --git a/src/main.ts b/src/main.ts index 75dbd11..1220342 100644 --- a/src/main.ts +++ b/src/main.ts @@ -34,6 +34,12 @@ async function installMamba(): Promise { await exec.exec('conda', ['install', '-y', '-c', 'conda-forge', 'mamba']) } +async function activate(os: string): Promise { + if (os === 'win32') { + await exec.exec('activate.bat', ['base']) + } +} + async function run(): Promise { try { const os = process.platform @@ -44,6 +50,9 @@ async function run(): Promise { core.debug('Add conda to the path') await addPath(os) + core.debug('Activate the environment') + activate(os) + core.debug('Installing mamba') await installMamba() } catch (error) { From ebf4c51058fd10bea8f268dac7b690e9476b0205 Mon Sep 17 00:00:00 2001 From: Jeremy Tuloup Date: Fri, 5 Jun 2020 16:28:44 +0200 Subject: [PATCH 02/17] Use full path to activate.bat --- src/main.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main.ts b/src/main.ts index 1220342..d49aede 100644 --- a/src/main.ts +++ b/src/main.ts @@ -36,7 +36,9 @@ async function installMamba(): Promise { async function activate(os: string): Promise { if (os === 'win32') { - await exec.exec('activate.bat', ['base']) + const basePath = process.env.CONDA as string + const activateFile = path.join(basePath, 'condabin', 'activate.bat') + await exec.exec(activateFile, ['base']) } } From f9e9f759da06c47f6382060946414b95b60ca721 Mon Sep 17 00:00:00 2001 From: Jeremy Tuloup Date: Fri, 5 Jun 2020 17:16:27 +0200 Subject: [PATCH 03/17] Run conda list, install xtensor --- .github/workflows/test.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 9df9790..88eb25f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -26,8 +26,10 @@ jobs: steps: - uses: actions/checkout@v2 - uses: ./ + - name: Run conda list + run: conda list - name: Install Python - run: mamba install -y -c conda-forge python + run: mamba install -y -c conda-forge xtensor - name: Install Notebook and widgets run: mamba install -y -c notebook ipywidgets - name: List the packages From 111746564897408b2012214c561a15d88b50a3ea Mon Sep 17 00:00:00 2001 From: Jeremy Tuloup Date: Fri, 5 Jun 2020 17:40:28 +0200 Subject: [PATCH 04/17] Call activate.bat with powershell --- dist/index.js | 4 +++- src/main.ts | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/dist/index.js b/dist/index.js index bd996d7..329520b 100644 --- a/dist/index.js +++ b/dist/index.js @@ -1024,7 +1024,9 @@ function installMamba() { function activate(os) { return __awaiter(this, void 0, void 0, function* () { if (os === 'win32') { - yield exec.exec('activate.bat', ['base']); + const basePath = process.env.CONDA; + const activateFile = path.join(basePath, 'condabin', 'activate.bat'); + yield exec.exec('conda', ['shell.powershell', activateFile, 'base']); } }); } diff --git a/src/main.ts b/src/main.ts index d49aede..6b38ecb 100644 --- a/src/main.ts +++ b/src/main.ts @@ -38,7 +38,7 @@ async function activate(os: string): Promise { if (os === 'win32') { const basePath = process.env.CONDA as string const activateFile = path.join(basePath, 'condabin', 'activate.bat') - await exec.exec(activateFile, ['base']) + await exec.exec('conda', ['shell.powershell', activateFile, 'base']) } } From 99f208dbcea657a42cd3b1f48f04d24584e77c7b Mon Sep 17 00:00:00 2001 From: Wolf Vollprecht Date: Fri, 5 Jun 2020 17:43:31 +0200 Subject: [PATCH 05/17] add more stuff to path --- src/main.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/main.ts b/src/main.ts index d49aede..52a9845 100644 --- a/src/main.ts +++ b/src/main.ts @@ -22,8 +22,13 @@ async function addPath(os: string): Promise { const bin = path.join(basePath, 'condabin') core.addPath(bin) } else if (os === 'win32') { - const bin = path.join(basePath, 'Scripts') - core.addPath(bin) + core.addPath(path.join(basePath, 'Library', 'bin')) + core.addPath(path.join(basePath, 'condabin')) + core.addPath(path.join(basePath, 'bin')) + core.addPath(path.join(basePath, 'Scripts')) + core.addPath(path.join(basePath, 'Library', 'usr', 'bin')) + core.addPath(path.join(basePath, 'Library', 'mingw-w64', 'bin')) + core.addPath(path.join(basePath)) } else { const bin = path.join(basePath, 'bin') core.addPath(bin) From ca635c0410176022307230a43df7bea459389d1e Mon Sep 17 00:00:00 2001 From: Wolf Vollprecht Date: Fri, 5 Jun 2020 17:49:35 +0200 Subject: [PATCH 06/17] .. --- .github/workflows/test.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 88eb25f..bf758ce 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -29,7 +29,12 @@ jobs: - name: Run conda list run: conda list - name: Install Python - run: mamba install -y -c conda-forge xtensor + run: | + echo $env:path + conda activate base + conda info + echo $env:path + mamba install -y -c conda-forge xtensor - name: Install Notebook and widgets run: mamba install -y -c notebook ipywidgets - name: List the packages From c478ff1b96b0487f1d7b84a9ea088b22bbbe595e Mon Sep 17 00:00:00 2001 From: Wolf Vollprecht Date: Fri, 5 Jun 2020 17:54:20 +0200 Subject: [PATCH 07/17] .. --- .github/workflows/test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index bf758ce..8fc2983 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -21,7 +21,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-latest, macos-latest, windows-latest] + os: [windows-latest] steps: - uses: actions/checkout@v2 @@ -31,7 +31,7 @@ jobs: - name: Install Python run: | echo $env:path - conda activate base + . activate.bat base conda info echo $env:path mamba install -y -c conda-forge xtensor From 664dbae26b52d13b49f94b727615496900fc1ac9 Mon Sep 17 00:00:00 2001 From: Jeremy Tuloup Date: Fri, 5 Jun 2020 18:04:25 +0200 Subject: [PATCH 08/17] npm run all in test job --- .github/workflows/test.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 8fc2983..2a24167 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -25,6 +25,9 @@ jobs: steps: - uses: actions/checkout@v2 + - run: | + npm install + npm run all - uses: ./ - name: Run conda list run: conda list From 7259738141d9ab316b1c582a7131ea9b2439c646 Mon Sep 17 00:00:00 2001 From: Wolf Vollprecht Date: Fri, 5 Jun 2020 18:10:57 +0200 Subject: [PATCH 09/17] .. --- .github/workflows/test.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 8fc2983..462e8b9 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -29,11 +29,12 @@ jobs: - name: Run conda list run: conda list - name: Install Python + shell: cmd run: | - echo $env:path - . activate.bat base + echo %PATH% + CALL activate.bat conda info - echo $env:path + echo %PATH% mamba install -y -c conda-forge xtensor - name: Install Notebook and widgets run: mamba install -y -c notebook ipywidgets From ef3e89eaa279d25d6bddc4f75a2bcd9e4f4b7053 Mon Sep 17 00:00:00 2001 From: Wolf Vollprecht Date: Fri, 5 Jun 2020 18:19:55 +0200 Subject: [PATCH 10/17] .. --- .github/workflows/test.yml | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index cb2e0c4..ec620a4 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -33,13 +33,8 @@ jobs: run: conda list - name: Install Python shell: cmd - run: | - echo %PATH% - CALL activate.bat - conda info - echo %PATH% - mamba install -y -c conda-forge xtensor + run: echo "%PATH%" && CALL activate.bat base && conda info && echo "%PATH%" && mamba install -y -c conda-forge xtensor - name: Install Notebook and widgets - run: mamba install -y -c notebook ipywidgets + run: mamba install -y -c conda-forge notebook ipywidgets - name: List the packages run: mamba list From 6630e6b48eb1121e4b03e46b1dbdc67ded2149be Mon Sep 17 00:00:00 2001 From: Wolf Vollprecht Date: Fri, 5 Jun 2020 19:02:20 +0200 Subject: [PATCH 11/17] .. --- .github/workflows/test.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ec620a4..a076ed2 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -33,7 +33,10 @@ jobs: run: conda list - name: Install Python shell: cmd - run: echo "%PATH%" && CALL activate.bat base && conda info && echo "%PATH%" && mamba install -y -c conda-forge xtensor + run: echo "%PATH%" && CALL activate.bat base && conda info && echo "%PATH%" + - name: Install stuff + shell: cmd + run: mamba install -y -c conda-forge xtensor - name: Install Notebook and widgets run: mamba install -y -c conda-forge notebook ipywidgets - name: List the packages From 0db1aae3c2d58ddbc61514fb0641165d1006435c Mon Sep 17 00:00:00 2001 From: Wolf Vollprecht Date: Fri, 5 Jun 2020 19:06:56 +0200 Subject: [PATCH 12/17] .. --- .github/workflows/test.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a076ed2..4136ef2 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -31,11 +31,13 @@ jobs: - uses: ./ - name: Run conda list run: conda list + - name: init pwsh + run: conda init powershell && conda activate base - name: Install Python - shell: cmd - run: echo "%PATH%" && CALL activate.bat base && conda info && echo "%PATH%" + # shell: cmd + # run: echo "%PATH%" && CALL activate.bat base && conda info && echo "%PATH%" + run: echo "$env:path" - name: Install stuff - shell: cmd run: mamba install -y -c conda-forge xtensor - name: Install Notebook and widgets run: mamba install -y -c conda-forge notebook ipywidgets From b5b0f06db52abbcad29ae2c4f5190a44ffd3dc40 Mon Sep 17 00:00:00 2001 From: Wolf Vollprecht Date: Fri, 5 Jun 2020 19:14:10 +0200 Subject: [PATCH 13/17] .. --- .github/workflows/test.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 4136ef2..35a6227 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -32,13 +32,13 @@ jobs: - name: Run conda list run: conda list - name: init pwsh - run: conda init powershell && conda activate base + run: conda init powershell - name: Install Python # shell: cmd # run: echo "%PATH%" && CALL activate.bat base && conda info && echo "%PATH%" - run: echo "$env:path" + run: conda activate base && echo "$env:path" - name: Install stuff - run: mamba install -y -c conda-forge xtensor + run: conda activate base && mamba install -y -c conda-forge xtensor - name: Install Notebook and widgets run: mamba install -y -c conda-forge notebook ipywidgets - name: List the packages From 2548a99a1d970d5bfe603e35161bb2026be07937 Mon Sep 17 00:00:00 2001 From: Jeremy Tuloup Date: Fri, 12 Jun 2020 11:18:51 +0200 Subject: [PATCH 14/17] Update .github/workflows/test.yml Co-authored-by: Dave Hirschfeld --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 35a6227..41fbc2a 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -32,7 +32,7 @@ jobs: - name: Run conda list run: conda list - name: init pwsh - run: conda init powershell + run: conda init --system powershell - name: Install Python # shell: cmd # run: echo "%PATH%" && CALL activate.bat base && conda info && echo "%PATH%" From b6beebd67321f490fc09684a5494f52ff686afa3 Mon Sep 17 00:00:00 2001 From: Wolf Vollprecht Date: Fri, 12 Jun 2020 11:51:09 +0200 Subject: [PATCH 15/17] Update .github/workflows/test.yml Co-authored-by: Dave Hirschfeld --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 41fbc2a..299a75b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -34,7 +34,7 @@ jobs: - name: init pwsh run: conda init --system powershell - name: Install Python - # shell: cmd + shell: powershell # run: echo "%PATH%" && CALL activate.bat base && conda info && echo "%PATH%" run: conda activate base && echo "$env:path" - name: Install stuff From 7d009d60b8be4d680f0f6c0b07bd5fc5834b40ca Mon Sep 17 00:00:00 2001 From: Wolf Vollprecht Date: Fri, 12 Jun 2020 11:51:15 +0200 Subject: [PATCH 16/17] Update .github/workflows/test.yml Co-authored-by: Dave Hirschfeld --- .github/workflows/test.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 299a75b..096e05f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -36,7 +36,10 @@ jobs: - name: Install Python shell: powershell # run: echo "%PATH%" && CALL activate.bat base && conda info && echo "%PATH%" - run: conda activate base && echo "$env:path" + run: | + conda activate base + conda env list + echo "$env:path" - name: Install stuff run: conda activate base && mamba install -y -c conda-forge xtensor - name: Install Notebook and widgets From 53cd7d14091ee5f6815a1a7f8c366f9da443c8d2 Mon Sep 17 00:00:00 2001 From: Wolf Vollprecht Date: Fri, 12 Jun 2020 12:30:35 +0200 Subject: [PATCH 17/17] Update test.yml --- .github/workflows/test.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 096e05f..73c640b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -41,8 +41,8 @@ jobs: conda env list echo "$env:path" - name: Install stuff - run: conda activate base && mamba install -y -c conda-forge xtensor + run: conda activate base && mamba.bat install -y -c conda-forge xtensor - name: Install Notebook and widgets - run: mamba install -y -c conda-forge notebook ipywidgets + run: mamba.bat install -y -c conda-forge notebook ipywidgets - name: List the packages - run: mamba list + run: mamba.bat list