From c9b1a748c3e0da72e388a025bc3bf980e35a3a6a Mon Sep 17 00:00:00 2001 From: DavertMik Date: Mon, 6 Jul 2026 03:59:29 +0300 Subject: [PATCH] ci(reporter): post test results to GitHub PR comments via @testomatio/reporter Enable the reporter's GitHub pipe across the mocha-based test workflows so each job posts a pass/fail summary as a PR comment. The reporter was already a devDependency and wired into every mocha script; this only supplies the CI environment it needs: - permissions: pull-requests: write (so github.token can comment) - GH_PAT: ${{ github.token }} (activates the GitHub pipe; matches webdriver.yml) - TESTOMATIO: ${{ secrets.TESTOMATIO }} (activates TMS pipe once the secret is set; dormant no-op until then) Also add the missing --reporter @testomatio/reporter/mocha flag to the bare Playwright/Puppeteer helper unit runs, and drop the now-redundant per-step GH_PAT in webdriver.yml (covered by workflow-level env). Scope is mocha tests only; CodeceptJS acceptance runs are untouched. Co-Authored-By: Claude Opus 4.8 --- .github/workflows/appium_Android.yml | 6 ++++++ .github/workflows/playwright.yml | 8 +++++++- .github/workflows/plugin.yml | 6 ++++++ .github/workflows/puppeteer.yml | 8 +++++++- .github/workflows/test.yml | 8 ++++++++ .github/workflows/webdriver.yml | 7 ++++++- 6 files changed, 40 insertions(+), 3 deletions(-) diff --git a/.github/workflows/appium_Android.yml b/.github/workflows/appium_Android.yml index 20c9e5efb..6236d7cd7 100644 --- a/.github/workflows/appium_Android.yml +++ b/.github/workflows/appium_Android.yml @@ -13,12 +13,18 @@ concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} cancel-in-progress: true +permissions: + contents: read + pull-requests: write + env: CI: true # Force terminal colors. @see https://www.npmjs.com/package/colors FORCE_COLOR: 1 SAUCE_ACCESS_KEY: ${{ secrets.SAUCE_ACCESS_KEY }} SAUCE_USERNAME: ${{ secrets.SAUCE_USERNAME }} + GH_PAT: ${{ github.token }} + TESTOMATIO: ${{ secrets.TESTOMATIO }} jobs: appium: diff --git a/.github/workflows/playwright.yml b/.github/workflows/playwright.yml index fe4559d9e..a7ac263ce 100644 --- a/.github/workflows/playwright.yml +++ b/.github/workflows/playwright.yml @@ -12,10 +12,16 @@ concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} cancel-in-progress: true +permissions: + contents: read + pull-requests: write + env: CI: true # Force terminal colors. @see https://www.npmjs.com/package/colors FORCE_COLOR: 1 + GH_PAT: ${{ github.token }} + TESTOMATIO: ${{ secrets.TESTOMATIO }} jobs: build: @@ -69,6 +75,6 @@ jobs: - name: run webkit tests run: 'BROWSER=webkit node ./bin/codecept.js run -c test/acceptance/codecept.Playwright.js --grep @Playwright --debug' - name: run chromium unit tests - run: ./node_modules/.bin/mocha test/helper/Playwright_test.js --timeout 15000 + run: ./node_modules/.bin/mocha test/helper/Playwright_test.js --timeout 15000 --reporter @testomatio/reporter/mocha - name: Stop mock server run: npm run mock-server:stop diff --git a/.github/workflows/plugin.yml b/.github/workflows/plugin.yml index 747ea1dec..3e49ab84d 100644 --- a/.github/workflows/plugin.yml +++ b/.github/workflows/plugin.yml @@ -12,10 +12,16 @@ concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} cancel-in-progress: true +permissions: + contents: read + pull-requests: write + env: CI: true # Force terminal colors. @see https://www.npmjs.com/package/colors FORCE_COLOR: 1 + GH_PAT: ${{ github.token }} + TESTOMATIO: ${{ secrets.TESTOMATIO }} jobs: build: diff --git a/.github/workflows/puppeteer.yml b/.github/workflows/puppeteer.yml index 957e9779e..306764370 100644 --- a/.github/workflows/puppeteer.yml +++ b/.github/workflows/puppeteer.yml @@ -12,10 +12,16 @@ concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} cancel-in-progress: true +permissions: + contents: read + pull-requests: write + env: CI: true # Force terminal colors. @see https://www.npmjs.com/package/colors FORCE_COLOR: 1 + GH_PAT: ${{ github.token }} + TESTOMATIO: ${{ secrets.TESTOMATIO }} jobs: build: @@ -55,6 +61,6 @@ jobs: - name: run tests run: './bin/codecept.js run-workers 2 -c test/acceptance/codecept.Puppeteer.js --grep @Puppeteer --debug' - name: run unit tests - run: ./node_modules/.bin/mocha test/helper/Puppeteer_test.js + run: ./node_modules/.bin/mocha test/helper/Puppeteer_test.js --reporter @testomatio/reporter/mocha - name: Stop mock server run: npm run mock-server:stop diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 4eb0de281..d5b39b033 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -12,6 +12,14 @@ concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} cancel-in-progress: true +permissions: + contents: read + pull-requests: write + +env: + GH_PAT: ${{ github.token }} + TESTOMATIO: ${{ secrets.TESTOMATIO }} + jobs: unit-tests: name: Unit tests diff --git a/.github/workflows/webdriver.yml b/.github/workflows/webdriver.yml index 9700c13e6..1c90a74c6 100644 --- a/.github/workflows/webdriver.yml +++ b/.github/workflows/webdriver.yml @@ -12,10 +12,16 @@ concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} cancel-in-progress: true +permissions: + contents: read + pull-requests: write + env: CI: true # Force terminal colors. @see https://www.npmjs.com/package/colors FORCE_COLOR: 1 + GH_PAT: ${{ github.token }} + TESTOMATIO: ${{ secrets.TESTOMATIO }} jobs: build: @@ -55,7 +61,6 @@ jobs: run: './bin/codecept.js check -c test/acceptance/codecept.WebDriver.js' timeout-minutes: 2 env: - GH_PAT: ${{ github.token }} SELENIUM_HOST: localhost SELENIUM_PORT: 4444 - name: run unit tests