Skip to content

Commit

Permalink
Fixes for failing CI
Browse files Browse the repository at this point in the history
  • Loading branch information
WilliamJamieson committed Nov 22, 2024
1 parent aa456d7 commit be9dbb9
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 4 deletions.
14 changes: 13 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,21 @@ jobs:
with:
envs: |
- linux: rad
latest_crds_contexts:
uses: ./.github/workflows/contexts.yml
crds_context:
needs: [ latest_crds_contexts ]
runs-on: ubuntu-latest
steps:
- id: context
run: echo context=${{ github.event_name == 'workflow_dispatch' && (inputs.crds_context != '' && inputs.crds_context || needs.latest_crds_contexts.outputs.roman) || needs.latest_crds_contexts.outputs.roman }} >> $GITHUB_OUTPUT
outputs:
context: ${{ steps.context.outputs.context }}
test_with_romancal:
needs: [ crds_context ]
uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@924441154cf3053034c6513d5e06c69d262fb9a6 # v1.13.0
with:
envs: |
- linux: withromancal
- linux: romancal
coverage: codecov
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
5 changes: 2 additions & 3 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -49,16 +49,15 @@ uv_resolution =
oldestdeps: lowest-direct
deps =
xdist: pytest-xdist
cov: pytest-cov
oldestdeps: minimum_dependencies
cov: pytest-cov >= 4.1.0
rad: rad @ git+https://github.com/spacetelescope/rad.git@main#egg=rad
romancal: romancal[test] @ git+https://github.com/spacetelescope/romancal.git
devdeps: -r requirements-dev.txt
commands_pre =
{list_dependencies_command}
commands =
pytest \
romancal: -W ignore::DeprecationWarning -W ignore::UserWarning -W ignore::pytest.PytestUnknownMarkWarning -W ignore::pytest.PytestUnraisableExceptionWarning -W ignore::erfa.core.ErfaWarning -W ignore::roman_datamodels.datamodels._utils.FilenameMismatchWarning -W ignore::astropy.io.fits.verify.VerifyWarning -W ignore::RuntimeWarning --pyargs romancal \
romancal: -W ignore::DeprecationWarning -W ignore::UserWarning -W ignore::SyntaxWarning -W ignore::pytest.PytestUnknownMarkWarning -W ignore::pytest.PytestUnraisableExceptionWarning -W ignore::erfa.core.ErfaWarning -W ignore::roman_datamodels.datamodels._utils.FilenameMismatchWarning -W ignore::astropy.io.fits.verify.VerifyWarning -W ignore::RuntimeWarning --pyargs romancal \
xdist: -n auto \
cov: --cov=roman_datamodels --cov=tests --cov-config pyproject.toml --cov-report term-missing --cov-report xml \
{posargs}
Expand Down

0 comments on commit be9dbb9

Please sign in to comment.