Skip to content

Commit

Permalink
Merge pull request #3671 from dopplershift/action-tweaks
Browse files Browse the repository at this point in the history
Tweaks to internal actions
  • Loading branch information
dcamron authored Oct 31, 2024
2 parents 2bb4d56 + 3e80462 commit 29f28d4
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 4 deletions.
12 changes: 10 additions & 2 deletions .github/actions/build-docs/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ inputs:
description: 'Key to use for artifacts'
required: false
default: ''
make-targets:
description: 'Extra Makefile targets to build'
required: false
default: 'overridecheck'
outputs:
doc-version:
description: 'What version the docs correspond to'
Expand All @@ -23,7 +27,11 @@ runs:
- name: Set doc version
id: docversion
shell: bash -l {0}
run: echo "doc_version=$(python -c 'import metpy,re; print(re.search(r"(\d+\.\d+)", metpy.__version__)[0])')" >> $GITHUB_OUTPUT
run: echo "doc_version=$(python -c 'import importlib.metadata,os,re; print(re.search(r"(\d+\.\d+)", importlib.metadata.version(os.environ["GITHUB_REPOSITORY"].split("/")[-1].lower()))[0])')" >> $GITHUB_OUTPUT

- name: Show doc version
shell: bash -l {0}
run: echo Building docs for version ${{ steps.docversion.outputs.doc_version }}

- name: Build docs
shell: bash -l {0}
Expand All @@ -35,7 +43,7 @@ runs:
run: |
set -e -o pipefail
pushd docs
make overridecheck html O=-W 2>&1 | tee ../build.log && popd || (popd && false)
make ${{ inputs.make-targets }} html O=-W 2>&1 | tee ../build.log && popd || (popd && false)
- name: Run link checker
# Running linkchecker separately so that we avoid problems with vendored LICENSE
Expand Down
6 changes: 5 additions & 1 deletion .github/actions/install-pypi/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ inputs:
description: 'Whether to enable old builds for shapely and cartopy'
required: false
default: 'false'
need-cartopy:
description: 'Whether Cartopy support is needed'
required: false
default: 'false'

runs:
using: composite
Expand Down Expand Up @@ -74,7 +78,7 @@ runs:
-c ci/${{ inputs.version-file }} -c ci/${{ inputs.type }}_requirements.txt -c ci/extra_requirements.txt
- name: Download Cartopy Maps
if: ${{ inputs.need-extras == 'true' }}
if: ${{ inputs.need-cartopy == 'true' }}
shell: bash
run: ci/download_cartopy_maps.py

6 changes: 5 additions & 1 deletion .github/actions/run-tests/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ inputs:
description: 'Whether to upload coverage report'
required: false
default: 'true'
pytest-args:
description: 'Additional arguments to pass to pytest'
required: false
default: '-W error::metpy.deprecation.MetpyDeprecationWarning'
runs:
using: composite
steps:
Expand All @@ -26,7 +30,7 @@ runs:
# By running coverage in "parallel" mode and "combining", we can clean up the path names
run: |
set -e -o pipefail
python -m coverage run -p -m pytest --mpl -W error::metpy.deprecation.MetpyDeprecationWarning tests/ 2>&1 | tee tests-${{ inputs.key }}.log
python -m coverage run -p -m pytest --mpl ${{ inputs.pytest-args }} tests/ 2>&1 | tee tests-${{ inputs.key }}.log
python -m coverage combine
python -m coverage report
python -m coverage xml
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ jobs:
type: 'doc'
python-version: ${{ matrix.python-version }}
need-extras: true
need-cartopy: true

- name: Build docs
id: build-docs
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/tests-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ jobs:
type: 'test'
python-version: ${{ matrix.python-version }}
old-build: ${{ matrix.no-extras != 'No Extras' && matrix.dep-versions == 'Minimum' }}
need-cartopy: ${{ matrix.no-extras != 'No Extras' }}

- name: Run tests
uses: ./.github/actions/run-tests
Expand Down

0 comments on commit 29f28d4

Please sign in to comment.