Skip to content

Commit

Permalink
rework tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jaimergp committed Oct 4, 2024
1 parent 29b8ef4 commit c588d86
Showing 1 changed file with 19 additions and 11 deletions.
30 changes: 19 additions & 11 deletions .github/workflows/example-14.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ jobs:
if:
(github.event_name == 'schedule' && github.repository ==
'conda-incubator/setup-miniconda') || (github.event_name != 'schedule')
name: Ex14 (${{ matrix.os }}, ${{ matrix.conda-remove-defaults }})
name:
Ex14 (${{ matrix.os }}, remove=${{ matrix.conda-remove-defaults }},
channels=${{ matrix.channels }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
Expand All @@ -47,14 +49,20 @@ jobs:
channels: ${{ matrix.channels }}
python-version: "3.12"
conda-remove-defaults: ${{ matrix.conda-remove-defaults }}
- shell: bash -el {0}
- shell: bash -elc "python {0}"
run: |
channels=$(conda config --show channels --json | jq -r '.channels | join(",")')
echo $channels
if [[ "${{ matrix.conda-remove-defaults }}" == "true" ]]; then
if [[ "$channels" != "conda-forge" ]]; then
exit 1
fi
elif [[ "$channels" != "conda-forge,defaults" ]]; then
exit 1
fi
from conda.base.context import context
channels = context.channels
input_channels = "${{ matrix.channels }}"
remove_defaults = "${{ matrix.conda-remove-defaults }}" == "true"
print("Input channels:", input_channels)
print("Input remove-defaults:", remove_defaults)
print("Computed channels":, channels)
assert "nodefaults" not in channels
if "defaults" in input_channels:
assert "defaults" in channels
elif "nodefaults" in input_channels or remove_defaults:
assert "defaults" not in channels

0 comments on commit c588d86

Please sign in to comment.