From 9bb68f41b5f49f2a1281d190ac580691f319cafa Mon Sep 17 00:00:00 2001 From: Marvin Zhang Date: Tue, 22 Oct 2024 16:05:56 +0800 Subject: [PATCH] ci: updated workflow --- .github/workflows/docker-crawlab.yml | 16 ++++++---------- backend/README.md | 1 + 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/.github/workflows/docker-crawlab.yml b/.github/workflows/docker-crawlab.yml index 4eb9f23f..09dada35 100644 --- a/.github/workflows/docker-crawlab.yml +++ b/.github/workflows/docker-crawlab.yml @@ -157,11 +157,6 @@ jobs: (needs.setup.outputs.frontend_changed == 'true' && needs.build_frontend.result == 'success') || (needs.setup.outputs.dockerfile_changed == 'true')) runs-on: ubuntu-latest - services: - mongo: - image: mongo:5 - ports: - - 27017:27017 steps: - uses: actions/checkout@v4 @@ -211,7 +206,7 @@ jobs: - name: Load Docker image run: docker load --input /tmp/crawlab-image-${{ github.sha }}.tar - - name: Test image + - name: Run Docker container run: | docker run --rm -d --name crawlab_master \ -e CRAWLAB_NODE_MASTER=true \ @@ -222,9 +217,6 @@ jobs: --network host \ crawlab:${{ github.sha }} docker ps - sleep 10 - docker logs -f crawlab_master & - sleep 10 - name: Setup Node.js uses: actions/setup-node@v3 @@ -232,23 +224,27 @@ jobs: node-version: '20' - name: Install Playwright and dependencies + id: install_playwright run: | npm init -y npm install @playwright/test npx playwright install --with-deps - name: Run Playwright tests + id: run_playwright run: | cd tests/e2e npx playwright test - name: Upload Playwright report + id: upload_playwright_report uses: actions/upload-artifact@v3 - if: always() + if: ${{ always() && steps.install_playwright.outcome == 'success' }} with: name: playwright-report path: tests/e2e/playwright-report/ retention-days: 30 + push_images: if: ${{ always() && needs.test_crawlab.result == 'success' }} needs: [setup, test_crawlab] diff --git a/backend/README.md b/backend/README.md index a1d4b01a..dafe39e1 100644 --- a/backend/README.md +++ b/backend/README.md @@ -1,3 +1,4 @@ # crawlab-backend Backend (Golang) for Crawlab +