Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

don't use crds sync for CRDS caching, and also consolidate CI jobs #7444

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
79 changes: 79 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,85 @@ on:
# Weekly Monday 9AM build
- cron: "0 9 * * 1"

env:
CRDS_SERVER_URL: https://jwst-crds.stsci.edu
CRDS_PATH: /tmp/crds_cache
CRDS_CLIENT_RETRY_COUNT: 3
CRDS_CLIENT_RETRY_DELAY_SECONDS: 20

jobs:
test:
name: ${{ matrix.toxenv }} (Python ${{ matrix.python-version }}, ${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
toxenv: [ test-xdist ]
python-version: [ '3.8', '3.9', '3.10', '3.11' ]
os: [ ubuntu-latest, macos-latest ]
include:
- toxenv: check-style
os: ubuntu-latest
python-version: '3.x'
- toxenv: check-security
os: ubuntu-latest
python-version: '3.x'
- toxenv: check-dependencies
os: ubuntu-latest
python-version: '3.x'
- toxenv: build-dist
os: ubuntu-latest
python-version: '3.x'
- toxenv: test-cov-xdist
os: ubuntu-latest
python-version: '3.11'
- toxenv: test-pyargs-xdist
os: ubuntu-latest
python-version: '3.11'
- toxenv: test-sdpdeps-xdist
os: ubuntu-latest
python-version: '3.9'
- toxenv: test-oldestdeps-xdist-cov
os: ubuntu-latest
python-version: '3.8'
- toxenv: test-opencv-xdist
os: ubuntu-latest
python-version: '3.10'
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
cache-dependency-path: 'setup.cfg'
- if: ${{ contains(matrix.toxenv, 'test') && !contains(matrix.toxenv, 'opencv') }}
run: >
echo "pmap=$(
curl -s -X POST -d '{"jsonrpc": "1.0", "method": "get_default_context", "params": ["jwst"], "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-context
- if: ${{ contains(matrix.toxenv, 'test') && !contains(matrix.toxenv, 'opencv') }}
run: echo "CRDS CONTEXT ${{ steps.crds-context.outputs.pmap }}"
- if: ${{ contains(matrix.toxenv, 'test') && !contains(matrix.toxenv, 'opencv') }}
uses: actions/cache@v3
with:
path: ${{ env.CRDS_PATH }}
key: crds-${{ steps.crds-context.outputs.pmap }}
- run: pip install tox
- run: tox -e ${{ matrix.toxenv }}
- if: ${{ contains(matrix.toxenv, '-cov') }}
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.xml
flags: unit
fail_ci_if_error: true
=======
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
Expand Down
14 changes: 8 additions & 6 deletions .github/workflows/ci_cron.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,14 @@ jobs:
steps:
- id: 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-context
- run: echo "CRDS CONTEXT ${{ steps.crds-context.outputs.pmap }}"
- uses: actions/cache@v3
with:
path: ${{ env.CRDS_PATH }}
key: crds-reffiles-${{ steps.crds-context.outputs.pmap }}
- run: pip install tox
- run: tox -e ${{ matrix.toxenv }}
- id: path
run: echo "path=${{ env.CRDS_PATH }}" >> $GITHUB_OUTPUT
- id: server
Expand Down