From a232ef953f53c06a0eef6bd50dd6d33c8821f987 Mon Sep 17 00:00:00 2001 From: Zach Burnett Date: Mon, 12 Aug 2024 14:57:07 -0400 Subject: [PATCH] [SCSB-169] add user input to specify `CRDS_CONTEXT` (#8702) --- .github/workflows/ci.yml | 30 ++++++++++++++++++++++----- .github/workflows/ci_cron.yml | 32 +++++++++++++++++++++++++---- .github/workflows/tests_devdeps.yml | 30 ++++++++++++++++++++++----- 3 files changed, 78 insertions(+), 14 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index abb96ccb00..1b1f54cc37 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,9 +14,20 @@ on: # Weekly Monday 9AM build - cron: "0 9 * * 1" workflow_dispatch: + inputs: + crds_context: + description: CRDS context (leave blank for latest) + type: string + required: false + default: '' + crds_server: + description: CRDS server + type: string + required: false + default: https://jwst-crds.stsci.edu concurrency: - group: ${{ github.workflow }}-${{ github.ref }} + group: ${{ github.workflow }}-${{ github.ref }}-${{ inputs.crds_context }} cancel-in-progress: true jobs: @@ -32,19 +43,28 @@ jobs: default_python: "3.12" envs: | - linux: check-dependencies - crds_contexts: + latest_crds_contexts: uses: spacetelescope/crds/.github/workflows/contexts.yml@master + crds_context: + needs: [ latest_crds_contexts ] + runs-on: ubuntu-latest + steps: + - id: context + run: echo context=${{ github.event_name == 'workflow_dispatch' && (inputs.crds_context != '' && inputs.crds_context || needs.latest_crds_contexts.outputs.jwst) || needs.latest_crds_contexts.outputs.jwst }} >> $GITHUB_OUTPUT + outputs: + context: ${{ steps.context.outputs.context }} test: uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@v1 - needs: [ crds_contexts ] + needs: [ crds_context ] with: setenv: | CRDS_PATH: /tmp/data/crds_cache - CRDS_SERVER_URL: https://jwst-crds.stsci.edu + CRDS_SERVER_URL: ${{ github.event_name == 'workflow_dispatch' && inputs.crds_server || 'https://jwst-crds.stsci.edu' }} + CRDS_CONTEXT: ${{ needs.crds_context.outputs.context }} CRDS_CLIENT_RETRY_COUNT: 3 CRDS_CLIENT_RETRY_DELAY_SECONDS: 20 cache-path: /tmp/data/crds_cache - cache-key: crds-${{ needs.crds_contexts.outputs.jwst }} + cache-key: crds-${{ needs.crds_context.outputs.context }} envs: | - linux: py310-oldestdeps-xdist-cov pytest-results-summary: true diff --git a/.github/workflows/ci_cron.yml b/.github/workflows/ci_cron.yml index 80ae34a8be..33addc0358 100644 --- a/.github/workflows/ci_cron.yml +++ b/.github/workflows/ci_cron.yml @@ -5,22 +5,46 @@ on: # Weekly Monday 6AM build - cron: "0 0 * * 1" workflow_dispatch: + inputs: + crds_context: + description: CRDS context (leave blank for latest) + type: string + required: false + default: '' + crds_server: + description: CRDS server + type: string + required: false + default: https://jwst-crds.stsci.edu + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }}-${{ inputs.crds_context }} + cancel-in-progress: true jobs: - crds_contexts: + latest_crds_contexts: uses: spacetelescope/crds/.github/workflows/contexts.yml@master + crds_context: + needs: [ latest_crds_contexts ] + runs-on: ubuntu-latest + steps: + - id: context + run: echo context=${{ github.event_name == 'workflow_dispatch' && (inputs.crds_context != '' && inputs.crds_context || needs.latest_crds_contexts.outputs.jwst) || needs.latest_crds_contexts.outputs.jwst }} >> $GITHUB_OUTPUT + outputs: + context: ${{ steps.context.outputs.context }} test: if: (github.repository == 'spacetelescope/jwst' && (github.event_name == 'schedule' || github.event_name == 'push' || github.event_name == 'workflow_dispatch' || contains(github.event.pull_request.labels.*.name, 'run scheduled tests'))) uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@v1 - needs: [ crds_contexts ] + needs: [ crds_context ] with: setenv: | CRDS_PATH: /tmp/crds_cache - CRDS_SERVER_URL: https://jwst-crds.stsci.edu + CRDS_SERVER_URL: ${{ github.event_name == 'workflow_dispatch' && inputs.crds_server || 'https://jwst-crds.stsci.edu' }} + CRDS_CONTEXT: ${{ needs.crds_context.outputs.context }} CRDS_CLIENT_RETRY_COUNT: 3 CRDS_CLIENT_RETRY_DELAY_SECONDS: 20 cache-path: /tmp/crds_cache - cache-key: crds-${{ needs.crds_context.outputs.jwst }} + cache-key: crds-${{ needs.crds_context.outputs.context }} envs: | - macos: py310-xdist - macos: py312-xdist diff --git a/.github/workflows/tests_devdeps.yml b/.github/workflows/tests_devdeps.yml index 49ad482d5b..6e0aef5081 100644 --- a/.github/workflows/tests_devdeps.yml +++ b/.github/workflows/tests_devdeps.yml @@ -14,26 +14,46 @@ on: # Weekly Monday 9AM build - cron: "0 9 * * 1" workflow_dispatch: + inputs: + crds_context: + description: CRDS context (leave blank for latest) + type: string + required: false + default: '' + crds_server: + description: CRDS server + type: string + required: false + default: https://jwst-crds.stsci.edu concurrency: - group: ${{ github.workflow }}-${{ github.ref }} + group: ${{ github.workflow }}-${{ github.ref }}-${{ inputs.crds_context }} cancel-in-progress: true jobs: - crds_contexts: + latest_crds_contexts: uses: spacetelescope/crds/.github/workflows/contexts.yml@master + crds_context: + needs: [ latest_crds_contexts ] + runs-on: ubuntu-latest + steps: + - id: context + run: echo context=${{ github.event_name == 'workflow_dispatch' && (inputs.crds_context != '' && inputs.crds_context || needs.latest_crds_contexts.outputs.jwst) || needs.latest_crds_contexts.outputs.jwst }} >> $GITHUB_OUTPUT + outputs: + context: ${{ steps.context.outputs.context }} test: if: (github.repository == 'spacetelescope/jwst' && (github.event_name == 'schedule' || github.event_name == 'push' || github.event_name == 'workflow_dispatch' || contains(github.event.pull_request.labels.*.name, 'run devdeps tests'))) uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@v1 - needs: [ crds_contexts ] + needs: [ crds_context ] with: setenv: | CRDS_PATH: /tmp/data/crds_cache - CRDS_SERVER_URL: https://jwst-crds.stsci.edu + CRDS_SERVER_URL: ${{ github.event_name == 'workflow_dispatch' && inputs.crds_server || 'https://jwst-crds.stsci.edu' }} + CRDS_CONTEXT: ${{ needs.crds_context.outputs.context }} CRDS_CLIENT_RETRY_COUNT: 3 CRDS_CLIENT_RETRY_DELAY_SECONDS: 20 cache-path: /tmp/data/crds_cache - cache-key: crds-${{ needs.crds_contexts.outputs.jwst }} + cache-key: crds-${{ needs.crds_context.outputs.context }} envs: | - linux: py3-xdist pytest-results-summary: true