Skip to content

Commit

Permalink
Feature dtcenter/MET#2796 main_v5.1 GHA Node20 deprecation warnings (#…
Browse files Browse the repository at this point in the history
…2474)

* per dtcenter/MET#2796, update versions of actions to prevent deprecated node warnings in GHA runs - main_v5.1

* fix ReadTheDocs requirements to include pillow which is a dependency of sphinx-gallery: see https://blog.readthedocs.com/defaulting-latest-build-tools/ for more info on why this was necessary

* install python packages via apk instead of pip to prevent GHA failures that were fixed in develop but not in main_v5.1

* per dtcenter/MET#2796, fix error log merging for main_v5.1 same as develop
  • Loading branch information
georgemccabe authored Jan 26, 2024
1 parent a831570 commit cb46573
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 20 deletions.
4 changes: 1 addition & 3 deletions .github/actions/run_tests/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ FROM alpine:latest
COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh

RUN apk add --update --no-cache docker python3 py3-pip bash

RUN pip3 install python-dateutil requests
RUN apk add --update --no-cache docker python3 py3-pip bash py3-dateutil py3-requests

ENTRYPOINT ["/entrypoint.sh"]
8 changes: 4 additions & 4 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ jobs:
name: Documentation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Install dependencies
Expand All @@ -27,12 +27,12 @@ jobs:
python -m pip install -r docs/requirements.txt
- name: Build Documentation
run: ./.github/jobs/build_documentation.sh
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
if: always()
with:
name: METplus_documentation
path: artifact/documentation
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
if: failure()
with:
name: documentation_warnings.log
Expand Down
47 changes: 37 additions & 10 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set job controls
id: job_status
run: .github/jobs/set_job_controls.sh
Expand All @@ -88,8 +88,8 @@ jobs:
needs: job_control
if: ${{ needs.job_control.outputs.run_get_image == 'true' }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Get METplus Image
Expand Down Expand Up @@ -130,7 +130,7 @@ jobs:
matrix: ${{fromJson(needs.job_control.outputs.matrix)}}
steps:

- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Free disk space
run: .github/jobs/free_disk_space.sh
Expand Down Expand Up @@ -173,36 +173,63 @@ jobs:
run: .github/jobs/copy_output_to_artifact.sh ${{ steps.get-artifact-name.outputs.artifact_name }}

- name: Upload output data artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
if: ${{ always() && steps.run_tests.conclusion != 'skipped' && !startsWith(matrix.categories,'pytests') }}
with:
name: ${{ steps.get-artifact-name.outputs.artifact_name }}
path: artifact/${{ steps.get-artifact-name.outputs.artifact_name }}

- name: Upload error logs artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
if: ${{ always() && steps.save-errors.outputs.upload_error_logs }}
with:
name: error_logs
name: error_logs-${{ steps.get-artifact-name.outputs.artifact_name }}
path: artifact/error_logs
if-no-files-found: ignore

- name: Upload difference data artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
if: ${{ always() && steps.run-diff.outputs.upload_diff == 'true' }}
with:
name: diff-${{ steps.get-artifact-name.outputs.artifact_name }}
path: artifact/diff-${{ steps.get-artifact-name.outputs.artifact_name }}
if-no-files-found: ignore

merge_error_logs:
name: Merge Error Logs
runs-on: ubuntu-latest
needs: use_case_tests
if: ${{ always() && needs.use_case_tests.result == 'failure' }}
steps:
- uses: actions/checkout@v4
- name: Check for error logs
id: check-for-error-logs
run: |
json_data=$(curl -s -H "Authorization: Bearer ${{ github.token }}" \
"https://api.github.com/repos/${{ github.repository }}/actions/runs/${{ github.run_id }}/jobs")
error_log_jobs=($(echo "$json_data" | jq -r '.jobs[] | select(.name | startswith("Use Case Tests")) | .steps[] | select(.name | startswith("Save error logs")) | select(.conclusion | startswith("success"))'))
# save output variable to merge error logs if any error logs were created
if [ ! -z "${error_log_jobs}" ]; then
echo "has_error_logs=true" >> $GITHUB_OUTPUT
else
echo "has_error_logs=false" >> $GITHUB_OUTPUT
fi
- name: Merge Artifacts
if: ${{ always() && steps.check-for-error-logs.outputs.has_error_logs == 'true' }}
uses: actions/upload-artifact/merge@v4
with:
name: error_logs
pattern: error_logs-*
delete-merged: true

create_output_data_volumes:
name: Create Output Docker Data Volumes
runs-on: ubuntu-latest
needs: [use_case_tests]
if: ${{ needs.job_control.outputs.run_save_truth_data == 'true' }}
steps:
- uses: actions/checkout@v3
- uses: actions/download-artifact@v3
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
- run: .github/jobs/create_output_data_volumes.sh
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/update_truth.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
fi
echo ERROR: Branch is $branch_name - must be develop or match main_vX.Y
exit 1
- uses: actions/checkout@v3
- uses: actions/checkout@v4
name: Checkout repository
with:
fetch-depth: 0
Expand Down
5 changes: 3 additions & 2 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
sphinx-gallery==0.11.1
sphinx==5.3.0
sphinx-rtd-theme==1.2.0
pillow==10.0.1
sphinx-gallery==0.14.0
sphinx-rtd-theme==1.3.0
sphinx-design==0.3.0

0 comments on commit cb46573

Please sign in to comment.