diff --git a/.github/workflows/test-e2e.yml b/.github/workflows/test-e2e.yml index 74ebd1c43..87fdb2bf0 100644 --- a/.github/workflows/test-e2e.yml +++ b/.github/workflows/test-e2e.yml @@ -2,8 +2,46 @@ name: ocelot.social end-to-end test CI on: push jobs: + docker_preparation: + name: Fullstack test preparation + runs-on: ubuntu-latest + outputs: + pr-number: ${{ steps.pr.outputs.number }} + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Copy env files + run: | + cp webapp/.env.template webapp/.env + cp backend/.env.template backend/.env + + - name: Build docker images + run: | + mkdir /tmp/images + docker build --target community -t "ocelotsocialnetwork/neo4j-community:test" neo4j/ + docker save "ocelotsocialnetwork/neo4j-community:test" > /tmp/images/neo4j.tar + docker build --target test -t "ocelotsocialnetwork/backend:test" backend/ + docker save "ocelotsocialnetwork/backend:test" > /tmp/images/backend.tar + docker build --target test -t "ocelotsocialnetwork/webapp:test" webapp/ + docker save "ocelotsocialnetwork/webapp:test" > /tmp/images/webapp.tar + + - name: Get pr number + id: pr + uses: 8BitJonny/gh-get-current-pr@2.2.0 + + - name: Cache docker images + id: cache + uses: actions/cache/save@v3.3.1 + with: + path: | + /tmp/images/ + key: e2e-preparation-cache-pr${{ steps.pr.outputs.number }} + fullstack_tests: name: Fullstack tests + if: success() + needs: docker_preparation runs-on: ubuntu-latest env: jobs: 8