diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 50238058..c0f55b6a 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -16,7 +16,7 @@ on: # Cancel in-progress workflows when pushing # a new commit on the same branch concurrency: - group: ${{ github.workflow }}-${{ github.ref }} + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} cancel-in-progress: true jobs: @@ -214,7 +214,7 @@ jobs: run: # Need to use this shell to get conda working properly. # See https://github.com/marketplace/actions/setup-miniconda#important - shell: ${{ matrix.os == 'windows-latest' && 'cmd /C CALL {0}' || 'bash -el {0}' }} + shell: 'bash -el {0}' steps: @@ -239,11 +239,11 @@ jobs: - name: Install dependencies run: | - bash -el continuous_integration/install.sh + ./continuous_integration/install.sh - name: Test library run: | - bash -el continuous_integration/run_tests.sh + ./continuous_integration/run_tests.sh - name: Upload test results uses: actions/upload-artifact@v4 diff --git a/continuous_integration/install.sh b/continuous_integration/install.sh old mode 100644 new mode 100755 index 8e6523fc..745cc233 --- a/continuous_integration/install.sh +++ b/continuous_integration/install.sh @@ -46,6 +46,8 @@ make_conda() { TO_INSTALL="$TO_INSTALL python-gil" fi + # Need to source conda.sh before first conda command + source "$CONDA/etc/profile.d/conda.sh" # prevent mixing conda channels conda config --set channel_priority strict conda config --add channels $CHANNEL diff --git a/continuous_integration/run_tests.sh b/continuous_integration/run_tests.sh index 078bc89a..bc36f503 100755 --- a/continuous_integration/run_tests.sh +++ b/continuous_integration/run_tests.sh @@ -3,10 +3,12 @@ set -xe if [[ "$PACKAGER" == conda* ]] || [[ -z "$PACKAGER" ]]; then + source "$CONDA/etc/profile.d/conda.sh" conda activate testenv conda list elif [[ "$PACKAGER" == pip* ]]; then # we actually use conda to install the base environment: + source "$CONDA/etc/profile.d/conda.sh" conda activate testenv pip list elif [[ "$PACKAGER" == "ubuntu" ]]; then