Skip to content

Commit

Permalink
[fix][CI] Don't run "Pulsar CI checks completed" too early and fix di…
Browse files Browse the repository at this point in the history
…sk space issue in saving docker image (#17584)

* [fix][CI] Don't run "Pulsar CI checks completed" too early

- "if: always()" caused the job to run also when something failed

* Clean up disk space in "Build Pulsar docker image"

* Show disk space before and after cleaning

* Fix deleting files
  • Loading branch information
lhotari authored Sep 12, 2022
1 parent c1434fd commit 6751039
Showing 1 changed file with 24 additions and 1 deletion.
25 changes: 24 additions & 1 deletion .github/workflows/pulsar-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -555,6 +555,30 @@ jobs:
-Pmain,docker -Dmaven.test.skip=true -Ddocker.squash=true \
-Dspotbugs.skip=true -Dlicense.skip=true -Dcheckstyle.skip=true -Drat.skip=true
- name: Clean up disk space
run: |
# release disk space since saving docker image consumes local disk space
#
echo "::group::Available diskspace before cleaning"
time df -BM / /mnt
echo "::endgroup::"
echo "::group::Clean build directory"
# docker build changes some files to root ownership, fix this before deleting files
sudo chown -R $USER:$GROUP .
# clean build directories
time git clean -fdx
echo "::endgroup::"
echo "::group::Available diskspace after cleaning build directory"
time df -BM / /mnt
echo "::endgroup::"
echo "::group::Delete maven repository"
# delete maven repository
time rm -rf ~/.m2/repository
echo "::endgroup::"
echo "::group::Available diskspace after cleaning maven repository"
time df -BM / /mnt
echo "::endgroup::"
- name: save docker image apachepulsar/pulsar-test-latest-version:latest to Github artifact cache
run: |
$GITHUB_WORKSPACE/build/pulsar_ci_tool.sh docker_save_image_to_github_actions_artifacts apachepulsar/pulsar-test-latest-version:latest pulsar-test-latest-version-image
Expand Down Expand Up @@ -844,7 +868,6 @@ jobs:
'system-tests',
'macos-build'
]
if: always()
steps:
- name: checkout
if: ${{ needs.changed_files_job.outputs.docs_only != 'true' }}
Expand Down

0 comments on commit 6751039

Please sign in to comment.