Skip to content

Commit

Permalink
vendorize and fix crds workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
braingram committed Oct 21, 2024
1 parent 704873b commit cb93bfd
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 3 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/contexts.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: contexts

on:
workflow_call:
outputs:
roman:
value: ${{ jobs.contexts.outputs.roman }}
workflow_dispatch:

jobs:
contexts:
name: retrieve latest CRDS contexts
runs-on: ubuntu-latest
outputs:
roman: ${{ steps.roman_crds_context.outputs.pmap }}
steps:
- id: roman_crds_context
env:
OBSERVATORY: roman
CRDS_SERVER_URL: https://roman-crds.stsci.edu
run: >
echo "pmap=$(
curl -s -X POST -d '{"jsonrpc": "1.0", "method": "get_default_context", "params": ["${{ env.OBSERVATORY }}", null], "id": 1}' ${{ env.CRDS_SERVER_URL }}/json/ --retry 8 |
python -c "import sys, json; print(json.load(sys.stdin)['result'])"
)" >> $GITHUB_OUTPUT
- run: if [[ ! -z "${{ steps.roman_crds_context.outputs.pmap }}" ]]; then echo ${{ steps.roman_crds_context.outputs.pmap }}; else exit 1; fi
2 changes: 1 addition & 1 deletion .github/workflows/roman_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
with:
minimal: true
latest_crds_contexts:
uses: spacetelescope/crds/.github/workflows/contexts.yml@master
uses: ./.github/workflows/contexts.yml
crds_context:
needs: [ latest_crds_contexts ]
runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/roman_ci_cron.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
minimal: true
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
uses: ./.github/workflows/contexts.yml
crds_context:
needs: [ latest_crds_contexts ]
runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tests_devdeps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
minimal: true
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
uses: ./.github/workflows/contexts.yml
crds_context:
needs: [ latest_crds_contexts ]
runs-on: ubuntu-latest
Expand Down

0 comments on commit cb93bfd

Please sign in to comment.