Skip to content

Commit

Permalink
cache CRDS by context (#111)
Browse files Browse the repository at this point in the history
* cache CRDS by context

* install CRDS

* remove `set_env`

* simplify
  • Loading branch information
zacharyburnett authored Jan 24, 2023
1 parent c434220 commit 6b1d544
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 6 deletions.
19 changes: 18 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ jobs:
runs-on: ${{ matrix.os }}
env:
CRDS_PATH: /home/runner/work/stdatamodels/crds_cache
CRDS_CLIENT_RETRY_COUNT: 3
CRDS_CLIENT_RETRY_DELAY_SECONDS: 20
strategy:
fail-fast: false
matrix:
Expand All @@ -63,9 +65,24 @@ jobs:
python-version: ${{ matrix.python-version }}
cache: 'pip'
cache-dependency-path: setup.cfg
- run: echo "CRDS_SERVER_URL=https://jwst-crds.stsci.edu" >> $GITHUB_ENV
if: contains( matrix.toxenv, '-jwst')
- run: echo "CRDS_SERVER_URL=https://roman-crds.stsci.edu" >> $GITHUB_ENV
if: contains(matrix.toxenv, '-roman')
- run: pip install crds
if: contains(matrix.toxenv, '-jwst') || contains(matrix.toxenv, '-roman')
- run: echo "pmap=$(crds list --operational-context)" >> $GITHUB_OUTPUT
id: crds-context
- uses: actions/cache@v3
with:
path: ${{ env.CRDS_PATH }}
key: crds-${{ steps.crds-context.outputs.pmap }}
if: contains(matrix.toxenv, '-jwst') || contains(matrix.toxenv, '-roman')
- run: crds sync --contexts ${{ steps.crds-context.outputs.pmap }}
if: contains(matrix.toxenv, '-jwst') || contains(matrix.toxenv, '-roman')
- run: pip install "tox>=4.0"
- run: tox -e ${{ matrix.toxenv }}
- if: ${{ contains(matrix.toxenv,'-cov') }}
- if: contains(matrix.toxenv,'-cov')
uses: codecov/codecov-action@v3
with:
file: ./coverage.xml
Expand Down
6 changes: 1 addition & 5 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,7 @@ description =
xdist: using parallel processing
cov: with coverage
pass_env =
jwst: CRDS_*
set_env =
jwst: CRDS_CLIENT_RETRY_COUNT=3
jwst: CRDS_CLIENT_RETRY_DELAY_SECONDS=20
jwst: CRDS_SERVER_URL=https://jwst-crds.stsci.edu
jwst,romancal: CRDS_*
extras =
test
deps =
Expand Down

0 comments on commit 6b1d544

Please sign in to comment.