Skip to content

Commit

Permalink
[CI] add user input to specify CRDS_CONTEXT
Browse files Browse the repository at this point in the history
  • Loading branch information
zacharyburnett committed Aug 12, 2024
1 parent c0e726a commit 21a2e86
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 13 deletions.
25 changes: 20 additions & 5 deletions .github/workflows/roman_ci.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
name: test

on:
workflow_dispatch:
push:
branches:
- main
Expand All @@ -14,9 +13,16 @@ on:
schedule:
# Weekly Monday 9AM build
- cron: "0 9 * * 1"
workflow_dispatch:
inputs:
crds_context:
description: CRDS context
type: string
required: false
default: ''

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
group: ${{ github.workflow }}-${{ github.ref }}-${{ inputs.crds_context }}
cancel-in-progress: true

jobs:
Expand All @@ -29,18 +35,27 @@ jobs:
uses: spacetelescope/webbpsf/.github/workflows/retrieve_cache.yml@develop
with:
minimal: true
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: context=${{ github.event_name == 'workflow_dispatch' && (inputs.crds_context != '' && inputs.crds_context || needs.latest_crds_contexts.outputs.roman) || needs.latest_crds_contexts.outputs.roman }} >> $GITHUB_OUTPUT
outputs:
context: ${{ steps.context.outputs.context }}
test:
uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@v1
needs: [ webbpsf_data_cache, crds_contexts ]
needs: [ webbpsf_data_cache, crds_context ]
secrets:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
setenv: |
WEBBPSF_PATH: /tmp/data/webbpsf-data/
CRDS_PATH: /tmp/data/crds_cache/
CRDS_SERVER_URL: https://roman-crds.stsci.edu
CRDS_CONTEXT: ${{ needs.crds_context.outputs.context }}
CRDS_CLIENT_RETRY_COUNT: 3
CRDS_CLIENT_RETRY_DELAY_SECONDS: 20
DD_SERVICE: romancal
Expand All @@ -49,7 +64,7 @@ jobs:
DD_GIT_COMMIT_SHA: ${{ github.sha }}
DD_GIT_BRANCH: ${{ github.ref_name }}
cache-path: /tmp/data/
cache-key: data-${{ needs.webbpsf_data_cache.outputs.cache_key }}-${{ needs.crds_contexts.outputs.roman }}
cache-key: data-${{ needs.webbpsf_data_cache.outputs.cache_key }}-${{ needs.crds_context.outputs.context }}
cache-restore-keys: ${{ needs.webbpsf_data_cache.outputs.cache_key }}
envs: |
- linux: py310-oldestdeps-webbpsf-cov
Expand Down
23 changes: 19 additions & 4 deletions .github/workflows/roman_ci_cron.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,15 @@ on:
tags:
- "*"
workflow_dispatch:
inputs:
crds_context:
description: CRDS context
type: string
required: false
default: ''

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
group: ${{ github.workflow }}-${{ github.ref }}-${{ inputs.crds_context }}
cancel-in-progress: true

jobs:
Expand All @@ -28,23 +34,32 @@ jobs:
uses: spacetelescope/webbpsf/.github/workflows/retrieve_cache.yml@develop
with:
minimal: true
crds_contexts:
latest_crds_contexts:
if: (github.repository == 'spacetelescope/romancal' && (github.event_name == 'schedule' || github.event_name == 'push' || github.event_name == 'workflow_dispatch' || contains(github.event.pull_request.labels.*.name, 'run scheduled tests')))
uses: spacetelescope/crds/.github/workflows/contexts.yml@master
crds_context:
needs: [ latest_crds_contexts ]
runs-on: ubuntu-latest
steps:
- id: context
run: context=${{ github.event_name == 'workflow_dispatch' && (inputs.crds_context != '' && inputs.crds_context || needs.latest_crds_contexts.outputs.roman) || needs.latest_crds_contexts.outputs.roman }} >> $GITHUB_OUTPUT
outputs:
context: ${{ steps.context.outputs.context }}
test:
uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@v1
needs: [ webbpsf_data_cache, crds_contexts ]
needs: [ webbpsf_data_cache, crds_context ]
secrets:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
setenv: |
WEBBPSF_PATH: /tmp/data/webbpsf-data/
CRDS_PATH: /tmp/data/crds_cache/
CRDS_SERVER_URL: https://roman-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/
cache-key: data-${{ needs.webbpsf_data_cache.outputs.cache_key }}-${{ needs.crds_contexts.outputs.roman }}
cache-key: data-${{ needs.webbpsf_data_cache.outputs.cache_key }}-${{ needs.crds_context.outputs.context }}
cache-restore-keys: ${{ needs.webbpsf_data_cache.outputs.cache_key }}
envs: |
- macos: py310-webbpsf
Expand Down
23 changes: 19 additions & 4 deletions .github/workflows/tests_devdeps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,15 @@ on:
# Weekly Monday 9AM build
- cron: "0 9 * * 1"
workflow_dispatch:
inputs:
crds_context:
description: CRDS context
type: string
required: false
default: ''

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
group: ${{ github.workflow }}-${{ github.ref }}-${{ inputs.crds_context }}
cancel-in-progress: true

jobs:
Expand All @@ -29,21 +35,30 @@ jobs:
uses: spacetelescope/webbpsf/.github/workflows/retrieve_cache.yml@develop
with:
minimal: true
crds_contexts:
latest_crds_contexts:
if: (github.repository == 'spacetelescope/romancal' && (github.event_name == 'schedule' || github.event_name == 'push' || github.event_name == 'workflow_dispatch' || contains(github.event.pull_request.labels.*.name, 'run devdeps tests')))
uses: spacetelescope/crds/.github/workflows/contexts.yml@master
crds_context:
needs: [ latest_crds_contexts ]
runs-on: ubuntu-latest
steps:
- id: context
run: context=${{ github.event_name == 'workflow_dispatch' && (inputs.crds_context != '' && inputs.crds_context || needs.latest_crds_contexts.outputs.roman) || needs.latest_crds_contexts.outputs.roman }} >> $GITHUB_OUTPUT
outputs:
context: ${{ steps.context.outputs.context }}
test:
uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@v1
needs: [ webbpsf_data_cache, crds_contexts ]
needs: [ webbpsf_data_cache, crds_context ]
with:
setenv: |
WEBBPSF_PATH: /tmp/data/webbpsf-data/
CRDS_PATH: /tmp/data/crds_cache/
CRDS_SERVER_URL: https://roman-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/
cache-key: data-${{ needs.webbpsf_data_cache.outputs.cache_key }}-${{ needs.crds_contexts.outputs.roman }}
cache-key: data-${{ needs.webbpsf_data_cache.outputs.cache_key }}-${{ needs.crds_context.outputs.context }}
cache-restore-keys: ${{ needs.webbpsf_data_cache.outputs.cache_key }}
envs: |
- linux: py310-stdevdeps-webbpsf
Expand Down

0 comments on commit 21a2e86

Please sign in to comment.