diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index ebcca87f8785..755c49823311 100644 --- a/.github/workflows/build_and_test.yml +++ b/.github/workflows/build_and_test.yml @@ -338,12 +338,12 @@ jobs: for i in $(seq 1 5); do (docker exec mongo mongo rocketchat --eval 'db.dropDatabase()') && npm run testci -- --enterprise --test=testapi && s=0 && break || s=$? && sleep 1; done; (exit $s) - - name: Install Playwright + - name: 🎭 Install Playwright run: | cd ./apps/meteor/ npx playwright install --with-deps - - name: E2E Test UI + - name: 🎭 E2E Test UI env: TEST_MODE: 'true' MONGO_URL: mongodb://localhost:27017/rocketchat @@ -356,18 +356,35 @@ jobs: run: | echo -e 'pcm.!default {\n type hw\n card 0\n}\n\nctl.!default {\n type hw\n card 0\n}' > ~/.asoundrc Xvfb -screen 0 1024x768x24 :99 & - cd ./apps/meteor - docker exec mongo mongo rocketchat --eval 'db.dropDatabase()' && npm run testci -- --enterprise --test=test:e2e:ee - - name: Store playwright test trace + - name: 🎭 Extract e2e:coverage + run: | + NYC_OUTPUT=$(yarn test:playwright:coverage) + COVERAGE_REPORTS=$(grep -o '[^ ]*%' <<< "$NYC_OUTPUT") + echo "REPORT_STATEMENTS=$(sed -n 1p <<< "$COVERAGE_REPORTS")" >> $GITHUB_ENV + + - name: 🎭 Publish e2e:coverage badge + uses: RocketChat/ghpages-dynamic-badges-action@v1.0.0 + with: + label: "e2e:coverage" + message: "${{ env.REPORT_STATEMENTS }}" + target_folder: "./apps/meteor/tests/coverage-badges" + + - name: 🎭 Store playwright test trace uses: actions/upload-artifact@v2 if: failure() with: name: ee-playwright-test-trace path: ./apps/meteor/tests/e2e/test-failures* + - name: 🎭 Store ee-playwright-coverage + uses: actions/upload-artifact@v2 + with: + name: ee-playwright-coverage + path: ./apps/meteor/coverage + # notification: # runs-on: ubuntu-20.04 # needs: test