Merge pull request #9318 from zmstone/1107-ci-docker-prune-images-before-and-after-tests

ci: docker prune images before and after test
This commit is contained in:
Zaiming (Stone) Shi 2022-11-07 14:49:17 +01:00 committed by GitHub
commit 61bd712956
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 1 deletions

View File

@ -9,6 +9,7 @@ jobs:
runs-on: ${{ matrix.runs-on }}
strategy:
fail-fast: false
matrix:
otp:
- erl23.3.4.9-3
@ -29,6 +30,9 @@ jobs:
container: emqx/build-env:${{ matrix.otp }}-${{ matrix.os }}
steps:
- uses: AutoModality/action-clean@v1
# keep using v1 for now as the otp-23 image has an old version git
# TODO: change to v3 after OTP is upgraded to 23.3.4.18-1
- uses: actions/checkout@v1
- name: fix-git-unsafe-repository
run: git config --global --add safe.directory /__w/emqx/emqx

View File

@ -150,6 +150,7 @@ jobs:
run: |
docker rm -f $(docker ps -qa) || true
docker network rm $(docker network ls -q) || true
docker system prune --volumes -f
- name: docker compose up
working-directory: source
env:
@ -221,6 +222,11 @@ jobs:
- name: set log file name
if: failure()
run: echo "LOGFILENAME=logs-$(echo ${{ matrix.app_name }} | tr '/' '_')" >> $GITHUB_ENV
- name: stop containers
run: |
docker rm -f $(docker ps -qa) || true
docker network rm $(docker network ls -q) || true
docker system prune --volumes -f
- uses: actions/upload-artifact@v3
if: failure()
with:

View File

@ -87,5 +87,5 @@ fi
if [ "$WANT_JSON" = 'yes' ]; then
echo "${RESULT}" | xargs | tr -d '\n' | jq -R -s -c 'split(" ")'
else
echo "${RESULT}" | xargs
echo "${RESULT}"
fi