mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2026-01-19 11:21:26 +00:00
testwait buildx
This commit is contained in:
parent
d3f9ce4e45
commit
e6237f39ee
68
.github/workflows/test-e2e.yml
vendored
68
.github/workflows/test-e2e.yml
vendored
@ -3,8 +3,8 @@ name: ocelot.social end-to-end test CI
|
||||
on: push
|
||||
|
||||
jobs:
|
||||
prepare_backend_environment:
|
||||
name: Fullstack | prepare backend environment
|
||||
build_images:
|
||||
name: Build Docker Images
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
@ -23,7 +23,7 @@ jobs:
|
||||
target: community
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.1.7
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: docker/setup-buildx-action@v3
|
||||
|
||||
@ -38,45 +38,23 @@ jobs:
|
||||
outputs: type=docker,dest=/tmp/${{ matrix.service }}.tar
|
||||
|
||||
- name: Upload Docker image tarball
|
||||
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.0.2
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: ${{ matrix.service }}-image
|
||||
path: /tmp/${{ matrix.service }}.tar
|
||||
|
||||
prepare_webapp_image:
|
||||
name: Fullstack | prepare webapp image
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.1.7
|
||||
|
||||
- name: Copy backend env file
|
||||
run: |
|
||||
cp backend/.env.test_e2e backend/.env
|
||||
cp webapp/.env.template webapp/.env
|
||||
|
||||
- name: Build docker image
|
||||
run: |
|
||||
docker compose -f docker-compose.yml -f docker-compose.test.yml up --detach webapp --build --no-deps
|
||||
docker save "ghcr.io/ocelot-social-community/ocelot-social/webapp:test" > /tmp/webapp.tar
|
||||
|
||||
- name: Cache docker image
|
||||
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.0.2
|
||||
with:
|
||||
path: /tmp/webapp.tar
|
||||
key: ${{ github.run_id }}-e2e-webapp-cache
|
||||
|
||||
prepare_cypress:
|
||||
name: Fullstack | prepare cypress
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.1.7
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Copy env files
|
||||
run: |
|
||||
cp webapp/.env.template webapp/.env
|
||||
cp backend/.env.test_e2e backend/.env
|
||||
|
||||
- name: Install cypress requirements
|
||||
run: |
|
||||
wget --no-verbose -O /opt/cucumber-json-formatter "https://github.com/cucumber/json-formatter/releases/download/v19.0.0/cucumber-json-formatter-linux-386"
|
||||
@ -85,10 +63,9 @@ jobs:
|
||||
yarn build
|
||||
cd ..
|
||||
yarn install
|
||||
|
||||
- name: Cache docker image
|
||||
|
||||
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.0.2
|
||||
|
||||
- name: Cache cypress
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: |
|
||||
/opt/cucumber-json-formatter
|
||||
@ -99,17 +76,24 @@ jobs:
|
||||
fullstack_tests:
|
||||
name: Fullstack | tests
|
||||
if: success()
|
||||
needs: [prepare_backend_environment, prepare_webapp_image, prepare_cypress]
|
||||
needs: [build_images, prepare_cypress]
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
jobs: 8
|
||||
strategy:
|
||||
matrix:
|
||||
# run copies of the current job in parallel
|
||||
job: [1, 2, 3, 4, 5, 6, 7, 8]
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Download Docker image tarballs
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
path: /tmp
|
||||
|
||||
- name: Restore cypress cache
|
||||
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.0.2
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: |
|
||||
/opt/cucumber-json-formatter
|
||||
@ -139,12 +123,12 @@ jobs:
|
||||
run: |
|
||||
chmod +x /opt/cucumber-json-formatter
|
||||
sudo ln -fs /opt/cucumber-json-formatter /usr/bin/cucumber-json-formatter
|
||||
docker load < /tmp/neo4j.tar
|
||||
docker load < /tmp/backend.tar
|
||||
docker load < /tmp/minio.tar
|
||||
docker load < /tmp/minio-mc.tar
|
||||
docker load < /tmp/mailserver.tar
|
||||
docker load < /tmp/webapp.tar
|
||||
docker load -i /tmp/neo4j-image/neo4j.tar
|
||||
docker load -i /tmp/backend-image/backend.tar
|
||||
docker load -i /tmp/webapp-image/webapp.tar
|
||||
docker load -i /tmp/minio.tar || true
|
||||
docker load -i /tmp/minio-mc.tar || true
|
||||
docker load -i /tmp/mailserver.tar || true
|
||||
docker compose -f docker-compose.yml -f docker-compose.test.yml up --detach backend mailserver webapp
|
||||
|
||||
- name: Wait for webapp to be ready
|
||||
@ -164,7 +148,7 @@ jobs:
|
||||
- name: Full stack tests | if tests failed, upload report
|
||||
id: e2e-report
|
||||
if: ${{ failure() && steps.e2e-tests.conclusion == 'failure' }}
|
||||
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: ocelot-e2e-test-report-pr${{ needs.docker_preparation.outputs.pr-number }}
|
||||
path: /home/runner/work/Ocelot-Social/Ocelot-Social/cypress/reports/cucumber_html_report
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user