From d6818d56dc6e9017e0551924ee7faaa505bc9f21 Mon Sep 17 00:00:00 2001 From: Brett Graham Date: Wed, 9 Oct 2024 19:55:05 -0400 Subject: [PATCH] vendorize and fix crds workflow (#8869) --- .github/workflows/ci.yml | 2 +- .github/workflows/ci_cron.yml | 2 +- .github/workflows/contexts.yml | 26 ++++++++++++++++++++++++++ .github/workflows/tests_devdeps.yml | 2 +- 4 files changed, 29 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/contexts.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 932ae63efe..1e6e0a2ff9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -44,7 +44,7 @@ jobs: envs: | - linux: check-dependencies latest_crds_contexts: - uses: spacetelescope/crds/.github/workflows/contexts.yml@94138b4501c9487535fd6b977492fc1a2c319708 # 12.0.2 + uses: ./.github/workflows/contexts.yml crds_context: needs: [ latest_crds_contexts ] runs-on: ubuntu-latest diff --git a/.github/workflows/ci_cron.yml b/.github/workflows/ci_cron.yml index d116e6e938..05146f9fb2 100644 --- a/.github/workflows/ci_cron.yml +++ b/.github/workflows/ci_cron.yml @@ -23,7 +23,7 @@ concurrency: jobs: latest_crds_contexts: - uses: spacetelescope/crds/.github/workflows/contexts.yml@94138b4501c9487535fd6b977492fc1a2c319708 # 12.0.2 + uses: ./.github/workflows/contexts.yml crds_context: needs: [ latest_crds_contexts ] runs-on: ubuntu-latest diff --git a/.github/workflows/contexts.yml b/.github/workflows/contexts.yml new file mode 100644 index 0000000000..b3047bdb63 --- /dev/null +++ b/.github/workflows/contexts.yml @@ -0,0 +1,26 @@ +name: contexts + +on: + workflow_call: + outputs: + jwst: + value: ${{ jobs.contexts.outputs.jwst }} + workflow_dispatch: + +jobs: + contexts: + name: retrieve latest CRDS contexts + runs-on: ubuntu-latest + outputs: + jwst: ${{ steps.jwst_crds_context.outputs.pmap }} + steps: + - id: jwst_crds_context + env: + OBSERVATORY: jwst + CRDS_SERVER_URL: https://jwst-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 --connect-timeout 10 | + python -c "import sys, json; print(json.load(sys.stdin)['result'])" + )" >> $GITHUB_OUTPUT + - run: if [[ ! -z "${{ steps.jwst_crds_context.outputs.pmap }}" ]]; then echo ${{ steps.jwst_crds_context.outputs.pmap }}; else exit 1; fi diff --git a/.github/workflows/tests_devdeps.yml b/.github/workflows/tests_devdeps.yml index 6beefbdaa6..e5ad86b187 100644 --- a/.github/workflows/tests_devdeps.yml +++ b/.github/workflows/tests_devdeps.yml @@ -32,7 +32,7 @@ concurrency: jobs: latest_crds_contexts: - uses: spacetelescope/crds/.github/workflows/contexts.yml@94138b4501c9487535fd6b977492fc1a2c319708 # 12.0.2 + uses: ./.github/workflows/contexts.yml crds_context: needs: [ latest_crds_contexts ] runs-on: ubuntu-latest