Skip to content

Commit

Permalink
Fix channel priority (#84)
Browse files Browse the repository at this point in the history
  • Loading branch information
jonashaag committed Jul 18, 2022
1 parent 52dc9e6 commit bc8e4cc
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 4 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/build.yml
Expand Up @@ -5,6 +5,10 @@ on:
- main
pull_request: null

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
timeout-minutes: 10
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/test.yml
Expand Up @@ -5,6 +5,10 @@ on:
- main
pull_request: null

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
test:
name: test
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/test_caching.yml
Expand Up @@ -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}
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/test_lock.yml
Expand Up @@ -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
Expand Down
11 changes: 11 additions & 0 deletions .github/workflows/test_options.yml
Expand Up @@ -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}
Expand Down Expand Up @@ -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: ./
Expand All @@ -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
Expand Down
3 changes: 1 addition & 2 deletions dist/main/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions index.js
Expand Up @@ -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(' ')
}
Expand Down Expand Up @@ -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)
}
Expand Down

0 comments on commit bc8e4cc

Please sign in to comment.