Skip to content

Commit

Permalink
[SCSB-169] add user input to specify CRDS_CONTEXT (#8702)
Browse files Browse the repository at this point in the history
  • Loading branch information
zacharyburnett committed Aug 12, 2024
1 parent 4ecb40c commit a232ef9
Show file tree
Hide file tree
Showing 3 changed files with 78 additions and 14 deletions.
30 changes: 25 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand Down
32 changes: 28 additions & 4 deletions .github/workflows/ci_cron.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
30 changes: 25 additions & 5 deletions .github/workflows/tests_devdeps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit a232ef9

Please sign in to comment.