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:
commit
61bd712956
|
@ -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
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue