Skip to content
This repository has been archived by the owner on Jun 26, 2023. It is now read-only.

Commit

Permalink
Test activate on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
jtpio committed Jun 5, 2020
1 parent 574b5e7 commit ec9225c
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 9 additions & 0 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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();
}
Expand Down
9 changes: 9 additions & 0 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@ async function installMamba(): Promise<void> {
await exec.exec('conda', ['install', '-y', '-c', 'conda-forge', 'mamba'])
}

async function activate(os: string): Promise<void> {
if (os === 'win32') {
await exec.exec('activate.bat', ['base'])
}
}

async function run(): Promise<void> {
try {
const os = process.platform
Expand All @@ -44,6 +50,9 @@ async function run(): Promise<void> {
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) {
Expand Down

0 comments on commit ec9225c

Please sign in to comment.