Skip to content

Commit

Permalink
use reusable workflow from CRDS
Browse files Browse the repository at this point in the history
  • Loading branch information
zacharyburnett committed Nov 17, 2023
1 parent b923d83 commit d4a7134
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 66 deletions.
43 changes: 9 additions & 34 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,30 +19,6 @@ concurrency:
cancel-in-progress: true

jobs:
data:
name: retrieve current CRDS context
runs-on: ubuntu-latest
env:
OBSERVATORY: jwst
CRDS_PATH: /tmp/crds_cache
CRDS_SERVER_URL: https://jwst-crds.stsci.edu
steps:
- id: crds_context
run: >
echo "pmap=$(
curl -s -X POST -d '{"jsonrpc": "1.0", "method": "get_default_context", "params": ["${{ env.OBSERVATORY }}"], "id": 1}' ${{ env.CRDS_SERVER_URL }}/json/ |
python -c "import sys, json; print(json.load(sys.stdin)['result'])"
)" >> $GITHUB_OUTPUT
# Get default CRDS_CONTEXT without installing crds client
# See https://hst-crds.stsci.edu/static/users_guide/web_services.html#generic-request
- id: crds_path
run: echo "path=${{ env.CRDS_PATH }}" >> $GITHUB_OUTPUT
- id: crds_server
run: echo "url=${{ env.CRDS_SERVER_URL }}" >> $GITHUB_OUTPUT
outputs:
crds_context: ${{ steps.crds_context.outputs.pmap }}
crds_path: ${{ steps.crds_path.outputs.path }}
crds_server: ${{ steps.crds_server.outputs.url }}
check:
uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@v1
with:
Expand All @@ -52,28 +28,27 @@ jobs:
- linux: check-security
- linux: check-dependencies
- linux: build-dist
crds_contexts:
uses: spacetelescope/crds/.github/workflows/contexts.yml@master
test:
uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@v1
needs: [ data ]
needs: [ crds_contexts ]
with:
setenv: |
CRDS_PATH: ${{ needs.data.outputs.crds_path }}
CRDS_SERVER_URL: ${{ needs.data.outputs.crds_server }}
CRDS_PATH: /tmp/data/crds_cache
CRDS_SERVER_URL: https://jwst-crds.stsci.edu
CRDS_CLIENT_RETRY_COUNT: 3
CRDS_CLIENT_RETRY_DELAY_SECONDS: 20
cache-path: ${{ needs.data.outputs.crds_path }}
cache-key: crds-${{ needs.data.outputs.crds_context }}
cache-path: /tmp/data/crds_cache
cache-key: crds-${{ needs.crds_contexts.outputs.jwst }}
envs: |
- linux: py39-oldestdeps-xdist-cov
pytest-results-summary: true
- linux: py39-xdist
- linux: py310-xdist
- linux: py311-xdist
- linux: py311-sdpdeps-xdist
- macos: py3-xdist
pytest-results-summary: true
- linux: py311-stdevdeps-xdist
- linux: py311-devdeps-xdist
- linux: py311-xdist
- macos: py311-xdist
- linux: py311-xdist-cov
coverage: codecov
pytest-results-summary: true
50 changes: 18 additions & 32 deletions .github/workflows/tests_devdeps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,47 +20,33 @@ concurrency:
cancel-in-progress: true

jobs:
data:
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')))
name: retrieve current CRDS context
runs-on: ubuntu-latest
env:
OBSERVATORY: jwst
CRDS_PATH: /tmp/crds_cache
CRDS_SERVER_URL: https://jwst-crds.stsci.edu
steps:
- id: crds_context
run: >
echo "pmap=$(
curl -s -X POST -d '{"jsonrpc": "1.0", "method": "get_default_context", "params": ["${{ env.OBSERVATORY }}"], "id": 1}' ${{ env.CRDS_SERVER_URL }}/json/ |
python -c "import sys, json; print(json.load(sys.stdin)['result'])"
)" >> $GITHUB_OUTPUT
# Get default CRDS_CONTEXT without installing crds client
# See https://hst-crds.stsci.edu/static/users_guide/web_services.html#generic-request
- id: crds_path
run: echo "path=${{ env.CRDS_PATH }}" >> $GITHUB_OUTPUT
- id: crds_server
run: echo "url=${{ env.CRDS_SERVER_URL }}" >> $GITHUB_OUTPUT
outputs:
crds_context: ${{ steps.crds_context.outputs.pmap }}
crds_path: ${{ steps.crds_path.outputs.path }}
crds_server: ${{ steps.crds_server.outputs.url }}
crds_contexts:
uses: spacetelescope/crds/.github/workflows/contexts.yml@master
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: [ data ]
needs: [ crds_contexts ]
with:
setenv: |
CRDS_PATH: ${{ needs.data.outputs.crds_path }}
CRDS_SERVER_URL: ${{ needs.data.outputs.crds_server }}
CRDS_PATH: /tmp/data/crds_cache
CRDS_SERVER_URL: https://jwst-crds.stsci.edu
CRDS_CLIENT_RETRY_COUNT: 3
CRDS_CLIENT_RETRY_DELAY_SECONDS: 20
cache-path: ${{ needs.data.outputs.crds_path }}
cache-key: crds-${{ needs.data.outputs.crds_context }}
cache-path: /tmp/data/crds_cache
cache-key: crds-${{ needs.crds_contexts.outputs.jwst }}
envs: |
- linux: py311-stdevdeps-xdist
pytest-results-summary: true
- linux: py311-devdeps-xdist
pytest-results-summary: true
- macos: py311-stdevdeps-xdist
pytest-results-summary: true
- macos: py311-devdeps-xdist
pytest-results-summary: true
- windows: py311-devdeps-xdist
- linux: py3-stdevdeps-xdist
pytest-results-summary: true
- linux: py3-devdeps-xdist
pytest-results-summary: true
- macos: py3-stdevdeps-xdist
pytest-results-summary: true
- macos: py3-devdeps-xdist
pytest-results-summary: true

0 comments on commit d4a7134

Please sign in to comment.