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

Tweaks to internal actions #3671

Merged
merged 4 commits into from
Oct 31, 2024
Merged
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
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