From be9dbb90313f562bcf2d58b901264b8b2afb6422 Mon Sep 17 00:00:00 2001 From: William Jamieson Date: Fri, 22 Nov 2024 16:13:13 -0500 Subject: [PATCH] Fixes for failing CI --- .github/workflows/ci.yml | 14 +++++++++++++- .github/workflows/contexts.yml | 26 ++++++++++++++++++++++++++ tox.ini | 5 ++--- 3 files changed, 41 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/contexts.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c1005dc6..cd1e0625 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 diff --git a/.github/workflows/contexts.yml b/.github/workflows/contexts.yml new file mode 100644 index 00000000..14e4c17b --- /dev/null +++ b/.github/workflows/contexts.yml @@ -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 diff --git a/tox.ini b/tox.ini index 757475bd..2a1c9e55 100644 --- a/tox.ini +++ b/tox.ini @@ -49,8 +49,7 @@ 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 @@ -58,7 +57,7 @@ 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}