From 9cd855249b214b89f118ef923107190e39055340 Mon Sep 17 00:00:00 2001 From: William Jamieson Date: Thu, 14 Nov 2024 13:01:54 -0500 Subject: [PATCH] Create downstream test workflow --- .github/workflows/ci.yml | 23 --------- .github/workflows/downstream.yml | 89 ++++++++++++++++++++++++++++++++ tox.ini | 45 ++++++++++++++++ 3 files changed, 134 insertions(+), 23 deletions(-) create mode 100644 .github/workflows/downstream.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e739461d..fde2ce6e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -32,7 +32,6 @@ jobs: with: envs: | - linux: py310 - - linux: py310-numpy123 - linux: py310-numpy125 - linux: py311 pytest-results-summary: true @@ -44,25 +43,3 @@ jobs: pytest-results-summary: true - linux: py312 - linux: py3-dev - environment: - runs-on: ubuntu-latest - steps: - - id: data_path - run: echo "path=${{ env.DATA_PATH }}" >> $GITHUB_OUTPUT - outputs: - data_path: ${{ steps.data_path.outputs.path }} - crds_contexts: - uses: ./.github/workflows/contexts.yml - test_downstream: - uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@924441154cf3053034c6513d5e06c69d262fb9a6 # v1.13.0 - needs: [ environment, crds_contexts ] - with: - setenv: | - CRDS_PATH: ${{ needs.environment.outputs.data_path }}/crds - CRDS_SERVER_URL: https://jwst-crds.stsci.edu - CRDS_CLIENT_RETRY_COUNT: 3 - CRDS_CLIENT_RETRY_DELAY_SECONDS: 20 - cache-path: ${{ needs.environment.outputs.data_path }}/crds - cache-key: crds-${{ needs.crds_contexts.outputs.jwst }} - envs: | - - linux: py311-test-jwst-cov-xdist diff --git a/.github/workflows/downstream.yml b/.github/workflows/downstream.yml new file mode 100644 index 00000000..f15f1ec1 --- /dev/null +++ b/.github/workflows/downstream.yml @@ -0,0 +1,89 @@ +name: Downstream + +on: + workflow_dispatch: + schedule: + # Weekly Monday 9AM build + # * is a special character in YAML so you have to quote this string + - cron: '0 9 * * 1' + pull_request: + # We also want this workflow triggered if the `Downstream CI` label is + # added or present when PR is updated + types: + - synchronize + - labeled + push: + tags: + - '*' + +env: + DATA_PATH: /tmp/data + +# Only cancel in-progress jobs or runs for the current workflow +# This cancels the already triggered workflows for a specific PR without canceling +# other instances of this workflow (other PRs, scheduled triggers, etc) when something +# within that PR re-triggers this CI +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + environment: + runs-on: ubuntu-latest + steps: + - id: data_path + run: echo "path=${{ env.DATA_PATH }}" >> $GITHUB_OUTPUT + outputs: + data_path: ${{ steps.data_path.outputs.path }} + + crds_contexts: + uses: ./.github/workflows/contexts.yml + + jwst: + uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@924441154cf3053034c6513d5e06c69d262fb9a6 # v1.13.0 + needs: [ environment, crds_contexts ] + with: + setenv: | + CRDS_PATH: ${{ needs.environment.outputs.data_path }}/crds + CRDS_SERVER_URL: https://jwst-crds.stsci.edu + CRDS_CLIENT_RETRY_COUNT: 3 + CRDS_CLIENT_RETRY_DELAY_SECONDS: 20 + cache-path: ${{ needs.environment.outputs.data_path }}/crds + cache-key: crds-${{ needs.crds_contexts.outputs.jwst }} + envs: | + - linux: py311-test-jwst-cov-xdist + + romancal: + uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@924441154cf3053034c6513d5e06c69d262fb9a6 # v1.13.0 + needs: [ environment, crds_contexts ] + with: + setenv: | + CRDS_PATH: ${{ needs.environment.outputs.data_path }}/crds + CRDS_SERVER_URL: https://roman-crds.stsci.edu + CRDS_CLIENT_RETRY_COUNT: 3 + CRDS_CLIENT_RETRY_DELAY_SECONDS: 20 + cache-path: ${{ needs.environment.outputs.data_path }}/crds + cache-key: crds-${{ needs.crds_contexts.outputs.jwst }} + envs: | + - linux: py311-test-romancal-cov-xdist + + astropy: + uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@924441154cf3053034c6513d5e06c69d262fb9a6 # v1.13.0 + if: (github.repository == 'spacetelescope/gwcs' && (github.event_name == 'schedule' || github.event_name == 'push' || github.event_name == 'workflow_dispatch' || contains(github.event.pull_request.labels.*.name, 'Downstream CI'))) + with: + submodules: false + # Any env name which does not start with `pyXY` will use this Python version. + default_python: '3.11' + envs: | + - linux: specutils + + third-party: + uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@924441154cf3053034c6513d5e06c69d262fb9a6 # v1.13.0 + if: (github.repository == 'spacetelescope/gwcs' && (github.event_name == 'schedule' || github.event_name == 'push' || github.event_name == 'workflow_dispatch' || contains(github.event.pull_request.labels.*.name, 'Downstream CI'))) + with: + submodules: false + # Any env name which does not start with `pyXY` will use this Python version. + default_python: '3.11' + envs: | + - linux: ndcube + - linux: dkist \ No newline at end of file diff --git a/tox.ini b/tox.ini index 59e42fef..f5e2ae74 100644 --- a/tox.ini +++ b/tox.ini @@ -100,3 +100,48 @@ deps = build commands = python -m build . + +[testenv:specutils] +change_dir = {env_tmp_dir} +allowlist_externals = + git + bash +extras = +commands_pre = + bash -c "pip freeze -q | grep 'gwcs @' > {env_tmp_dir}/requirements.txt" + git clone https://github.com/astropy/specutils.git + pip install -e specutils[test] + pip install -r {env_tmp_dir}/requirements.txt + pip list +commands = + pytest specutils + +[testenv:dkist] +change_dir = {env_tmp_dir} +allowlist_externals = + git + bash +extras = +commands_pre = + bash -c "pip freeze -q | grep 'gwcs @' > {env_tmp_dir}/requirements.txt" + git clone https://github.com/DKISTDC/dkist.git + pip install -e dkist[tests] + pip install -r {env_tmp_dir}/requirements.txt + pip list +commands = + pytest dkist --benchmark-skip + +[testenv:ndcube] +change_dir = {env_tmp_dir} +allowlist_externals = + git + bash +extras = +commands_pre = + bash -c "pip freeze -q | grep 'gwcs @' > {env_tmp_dir}/requirements.txt" + git clone https://github.com/sunpy/ndcube.git + pip install -e ndcube[all,tests] + pip install -r {env_tmp_dir}/requirements.txt + pip freeze +commands = + pytest ndcube