From bc8e4cc2f1ff923a42ae27a637c08d4623ebb31b Mon Sep 17 00:00:00 2001 From: Jonas Haag Date: Mon, 18 Jul 2022 14:50:13 +0200 Subject: [PATCH] Fix channel priority (#84) --- .github/workflows/build.yml | 4 ++++ .github/workflows/test.yml | 4 ++++ .github/workflows/test_caching.yml | 4 ++++ .github/workflows/test_lock.yml | 4 ++++ .github/workflows/test_options.yml | 11 +++++++++++ dist/main/index.js | 3 +-- index.js | 3 +-- 7 files changed, 29 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 64422ff7..a7badbc3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -5,6 +5,10 @@ on: - main pull_request: null +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + jobs: build: timeout-minutes: 10 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 0a4f4e64..234ac90f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -5,6 +5,10 @@ on: - main pull_request: null +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + jobs: test: name: test diff --git a/.github/workflows/test_caching.yml b/.github/workflows/test_caching.yml index 7c469c59..93347b9a 100644 --- a/.github/workflows/test_caching.yml +++ b/.github/workflows/test_caching.yml @@ -6,6 +6,10 @@ on: - main pull_request: null +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + defaults: run: shell: bash -l {0} diff --git a/.github/workflows/test_lock.yml b/.github/workflows/test_lock.yml index a8c17020..9242406f 100644 --- a/.github/workflows/test_lock.yml +++ b/.github/workflows/test_lock.yml @@ -5,6 +5,10 @@ on: - main pull_request: null +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + jobs: test: name: Test lock files diff --git a/.github/workflows/test_options.yml b/.github/workflows/test_options.yml index f8bf6584..86042863 100644 --- a/.github/workflows/test_options.yml +++ b/.github/workflows/test_options.yml @@ -5,6 +5,10 @@ on: - main pull_request: null +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + defaults: run: shell: bash -el {0} @@ -205,6 +209,12 @@ jobs: steps: - uses: actions/checkout@v2 + + - name: Modify environemnt.yml to require flexible channel priority + run: | + contents = open("environment.yml").read() + open("environment.yml", "w").write(contents.replace("python", "pkgs/main::python")) + shell: python - name: install mamba uses: ./ @@ -216,6 +226,7 @@ jobs: run: | cat ~/.condarc grep "channel_priority: flexible" ~/.condarc + micromamba list | grep -E 'python\s+3\.8' | grep -qv conda-forge test_condarc_file: name: Test condarc-file diff --git a/dist/main/index.js b/dist/main/index.js index 07fb9035..77022b04 100644 --- a/dist/main/index.js +++ b/dist/main/index.js @@ -63237,7 +63237,7 @@ async function createOrUpdateEnv (envName, envFilePath, extraSpecs, logLevel) { const action = fs.existsSync(envFolder) ? 'update' : 'create' const selectedExtraSpecs = selectSelectors(extraSpecs) core.info(`${action} env ${envName}`) - let cmd = micromambaCmd(`${action} -n ${envName} --strict-channel-priority -y`, logLevel, PATHS.micromambaExe) + let cmd = micromambaCmd(`${action} -n ${envName} -y`, logLevel, PATHS.micromambaExe) if (selectedExtraSpecs.length) { cmd += ' ' + selectedExtraSpecs.map(e => `"${e}"`).join(' ') } @@ -63318,7 +63318,6 @@ async function installEnvironment (inputs, envFilePath, envYaml) { const autoactivateCmd = `micromamba activate ${envName};` if (process.platform === 'win32') { const ps1File = (await executePwsh('echo $profile')).stdout.trim() - core.warning(path.dirname(ps1File)) fs.appendFileSync(ps1File, '\n' + autoactivateCmd) dumpFileContents(ps1File) } diff --git a/index.js b/index.js index 207125f9..e5cb20cc 100644 --- a/index.js +++ b/index.js @@ -305,7 +305,7 @@ async function createOrUpdateEnv (envName, envFilePath, extraSpecs, logLevel) { const action = fs.existsSync(envFolder) ? 'update' : 'create' const selectedExtraSpecs = selectSelectors(extraSpecs) core.info(`${action} env ${envName}`) - let cmd = micromambaCmd(`${action} -n ${envName} --strict-channel-priority -y`, logLevel, PATHS.micromambaExe) + let cmd = micromambaCmd(`${action} -n ${envName} -y`, logLevel, PATHS.micromambaExe) if (selectedExtraSpecs.length) { cmd += ' ' + selectedExtraSpecs.map(e => `"${e}"`).join(' ') } @@ -386,7 +386,6 @@ async function installEnvironment (inputs, envFilePath, envYaml) { const autoactivateCmd = `micromamba activate ${envName};` if (process.platform === 'win32') { const ps1File = (await executePwsh('echo $profile')).stdout.trim() - core.warning(path.dirname(ps1File)) fs.appendFileSync(ps1File, '\n' + autoactivateCmd) dumpFileContents(ps1File) }