Skip to content

Commit

Permalink
ci: add extract and store coverage steps
Browse files Browse the repository at this point in the history
  • Loading branch information
Ramon Souza committed Jun 15, 2022
1 parent 7c87fd0 commit 61864d3
Showing 1 changed file with 22 additions and 5 deletions.
27 changes: 22 additions & 5 deletions .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 61864d3

Please sign in to comment.