diff --git a/.github/workflows/test-backend.yml b/.github/workflows/test-backend.yml index e293f3e99..a96cff028 100644 --- a/.github/workflows/test-backend.yml +++ b/.github/workflows/test-backend.yml @@ -126,3 +126,19 @@ jobs: - name: backend | Unit test incl. coverage check run: docker-compose exec -T backend yarn test + + cleanup: + name: Cleanup + if: always() + needs: [files-changed, unit_test_backend] + runs-on: ubuntu-latest + steps: + - name: Delete cache + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + gh extension install actions/gh-actions-cache + KEY="backend-neo4j-cache-pr${{ needs.files-changed.outputs.pr-number }}" + gh actions-cache delete $KEY -R Ocelot-Social-Community/Ocelot-Social --confirm + KEY="backend-cache-pr${{ needs.files-changed.outputs.pr-number }}" + gh actions-cache delete $KEY -R Ocelot-Social-Community/Ocelot-Social --confirm diff --git a/.github/workflows/test-webapp.yml b/.github/workflows/test-webapp.yml index 5d603e388..772182778 100644 --- a/.github/workflows/test-webapp.yml +++ b/.github/workflows/test-webapp.yml @@ -92,11 +92,10 @@ jobs: - name: Load Docker Image run: docker load < /tmp/webapp.tar - - name: backend | copy env files webapp - run: cp webapp/.env.template webapp/.env - - - name: backend | copy env files backend - run: cp backend/.env.template backend/.env + - name: Copy env files + run: | + cp webapp/.env.template webapp/.env + cp backend/.env.template backend/.env - name: backend | docker-compose run: docker-compose -f docker-compose.yml -f docker-compose.test.yml up --detach --no-deps webapp @@ -104,3 +103,17 @@ jobs: - name: webapp | Unit tests incl. coverage check run: docker-compose exec -T webapp yarn test + cleanup: + name: Cleanup + if: always() + needs: [files-changed, unit_test_webapp] + runs-on: ubuntu-latest + steps: + - name: Delete cache + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + gh extension install actions/gh-actions-cache + KEY="webapp-cache-pr${{ needs.files-changed.outputs.pr-number }}" + gh actions-cache delete $KEY -R Ocelot-Social-Community/Ocelot-Social --confirm +