Skip to content

Commit c859309

Browse files
committed
maint: debug tweaks to release-env action
1 parent db10b6d commit c859309

1 file changed

Lines changed: 17 additions & 8 deletions

File tree

template/{{ package_name }}/.github/workflows/release-env.yml

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -180,18 +180,26 @@ jobs:
180180
activate-environment: test-env
181181
miniforge-version: latest
182182

183-
- name: Try installing new release env file
184-
shell: bash
183+
- name: Try installing new release env and check version info
185184
run: |
185+
set -e
186186
git checkout automated/release-${{ '{{' }} env.RELEASE_TAG {{ '}}' }}-env-file-updates
187187
ENV_PATH="environment-files/${{ '{{' }} env.PACKAGE_NAME {{ '}}' }}-qiime2-${{ '{{' }} env.TARGET_DISTRO {{ '}}' }}-${{ '{{' }} env.RELEASED_EPOCH {{ '}}' }}-release-${{ '{{' }} env.RELEASE_TAG {{ '}}' }}.yml"
188-
conda env create -n test-release-env -f $ENV_PATH
189188
190-
- name: Activate and check version info
191-
run: |
189+
conda env create -n test-release-env -f "$ENV_PATH"
190+
192191
source "$(conda info --base)/etc/profile.d/conda.sh"
193-
conda activate test-release-env
194-
conda list
192+
193+
echo "Activating 'test-release-env'..."
194+
if conda activate test-release-env; then
195+
echo "Activation succeeded."
196+
conda list
197+
echo "INSTALL_SUCCESS=true" >> $GITHUB_ENV
198+
else
199+
echo "Activation failed!"
200+
echo "INSTALL_SUCCESS=false" >> $GITHUB_ENV
201+
exit 1
202+
fi
195203
196204
- name: Get job ID
197205
if: always()
@@ -206,8 +214,9 @@ jobs:
206214
GH_TOKEN: ${{ '{{' }} github.token {{ '}}' }}
207215
JOB_URL: ${{ '{{' }} steps.get-job-id.outputs.html_url {{ '}}' }}
208216
PR_NUMBER: ${{ '{{' }} github.event.pull_request.number {{ '}}' }}
217+
INSTALL_SUCCESS: ${{ '{{' }} env.INSTALL_SUCCESS {{ '}}' }}
209218
run: |
210-
if conda env list | grep -q test-release-env; then
219+
if [[ "$INSTALL_SUCCESS" == "true" ]]; then
211220
gh pr comment "$PR_NUMBER" \
212221
--body ":white_check_mark: **Environment install test passed!**"
213222
else

0 commit comments

Comments
 (0)