ci: docker prune images before and after test

This commit is contained in:
Zaiming (Stone) Shi 2022-11-07 10:39:18 +01:00
parent 2998b014ce
commit 8f0ef274a8
2 changed files with 10 additions and 0 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: