diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 36fdb1ef96a..62387f99531 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -68,8 +68,8 @@ jobs: - name: Ping statistics server with test results run: | - curl https://raw.githubusercontent.com/hydephp/develop/08308fb9e9b4f72321bf90d37a8c9143a938a231/monorepo/scripts/ping-openanalytics-testrunner.php -o ping.php - php ping.php "Monorepo CI Matrix" ${{ secrets.OPENANALYTICS_TOKEN }} + curl https://raw.githubusercontent.com/hydephp/develop/4acc82cfb5ff431302dcbb2b11c5331efd47c872/monorepo/scripts/ping-openanalytics-testrunner.php -o ping.php + php ping.php "Monorepo CI Matrix" ${{ secrets.OPENANALYTICS_TOKEN }} ${{ github.ref_name }} system-testing: strategy: @@ -212,8 +212,8 @@ jobs: - name: Ping statistics server with test results run: | cp build/junit.xml report.xml - curl https://raw.githubusercontent.com/hydephp/develop/08308fb9e9b4f72321bf90d37a8c9143a938a231/monorepo/scripts/ping-openanalytics-testrunner.php -o ping.php - php ping.php "Monorepo PR Test" ${{ secrets.OPENANALYTICS_TOKEN }} + curl https://raw.githubusercontent.com/hydephp/develop/4acc82cfb5ff431302dcbb2b11c5331efd47c872/monorepo/scripts/ping-openanalytics-testrunner.php -o ping.php + php ping.php "Monorepo PR Test" ${{ secrets.OPENANALYTICS_TOKEN }} ${{ github.ref_name }} - name: Upload coverage artifacts uses: actions/upload-artifact@v1 diff --git a/.github/workflows/smoke-tests.yml b/.github/workflows/smoke-tests.yml index e19612d98b6..f4fafb92f16 100644 --- a/.github/workflows/smoke-tests.yml +++ b/.github/workflows/smoke-tests.yml @@ -29,8 +29,8 @@ jobs: - name: Ping statistics server with test results run: | - curl https://raw.githubusercontent.com/hydephp/develop/08308fb9e9b4f72321bf90d37a8c9143a938a231/monorepo/scripts/ping-openanalytics-testrunner.php -o ping.php - php ping.php "Monorepo Smoke Tests" ${{ secrets.OPENANALYTICS_TOKEN }} + curl https://raw.githubusercontent.com/hydephp/develop/4acc82cfb5ff431302dcbb2b11c5331efd47c872/monorepo/scripts/ping-openanalytics-testrunner.php -o ping.php + php ping.php "Monorepo Smoke Tests" ${{ secrets.OPENANALYTICS_TOKEN }} ${{ github.ref_name }} test-coverage: @@ -68,5 +68,5 @@ jobs: - name: Ping statistics server with test results run: | - curl https://raw.githubusercontent.com/hydephp/develop/08308fb9e9b4f72321bf90d37a8c9143a938a231/monorepo/scripts/ping-openanalytics-testrunner.php -o ping.php - php ping.php "Monorepo Smoke Tests - Coverage" ${{ secrets.OPENANALYTICS_TOKEN }} + curl https://raw.githubusercontent.com/hydephp/develop/4acc82cfb5ff431302dcbb2b11c5331efd47c872/monorepo/scripts/ping-openanalytics-testrunner.php -o ping.php + php ping.php "Monorepo Smoke Tests - Coverage" ${{ secrets.OPENANALYTICS_TOKEN }} ${{ github.ref_name }} diff --git a/.github/workflows/test-pull-requests.yml b/.github/workflows/test-pull-requests.yml index 31b2c61a89c..613d75da1de 100644 --- a/.github/workflows/test-pull-requests.yml +++ b/.github/workflows/test-pull-requests.yml @@ -51,8 +51,8 @@ jobs: - name: Ping statistics server with test results run: | cp build/junit.xml report.xml - curl https://raw.githubusercontent.com/hydephp/develop/08308fb9e9b4f72321bf90d37a8c9143a938a231/monorepo/scripts/ping-openanalytics-testrunner.php -o ping.php - php ping.php "Monorepo PR Test" ${{ secrets.OPENANALYTICS_TOKEN }} + curl https://raw.githubusercontent.com/hydephp/develop/4acc82cfb5ff431302dcbb2b11c5331efd47c872/monorepo/scripts/ping-openanalytics-testrunner.php -o ping.php + php ping.php "Monorepo PR Test" ${{ secrets.OPENANALYTICS_TOKEN }} ${{ github.ref_name }} test-matrix: strategy: @@ -77,5 +77,5 @@ jobs: - name: Ping statistics server with test results run: | - curl https://raw.githubusercontent.com/hydephp/develop/08308fb9e9b4f72321bf90d37a8c9143a938a231/monorepo/scripts/ping-openanalytics-testrunner.php -o ping.php - php ping.php "Monorepo PR Matrix" ${{ secrets.OPENANALYTICS_TOKEN }} + curl https://raw.githubusercontent.com/hydephp/develop/4acc82cfb5ff431302dcbb2b11c5331efd47c872/monorepo/scripts/ping-openanalytics-testrunner.php -o ping.php + php ping.php "Monorepo PR Matrix" ${{ secrets.OPENANALYTICS_TOKEN }} ${{ github.ref_name }} diff --git a/monorepo/scripts/ping-openanalytics-testrunner.php b/monorepo/scripts/ping-openanalytics-testrunner.php index d2451ceb489..c7d8e7c0298 100644 --- a/monorepo/scripts/ping-openanalytics-testrunner.php +++ b/monorepo/scripts/ping-openanalytics-testrunner.php @@ -3,7 +3,7 @@ /** * @internal This script is used to ping the OpenAnalytics server with the test results. * - * @example php ping.php 'Monorepo Smoke Tests' ${{ secrets.OPENANALYTICS_TOKEN }} + * @example php ping.php 'Monorepo Smoke Tests' ${{ secrets.OPENANALYTICS_TOKEN }} ${{ github.ref_name }} * * @uses vendor/bin/pest --stop-on-failure --log-junit report.xml */ @@ -11,6 +11,7 @@ $runner = $argv[1] ?? exit(400); $token = $argv[2] ?? null; +$branch = $argv[3] ?? null; if ($token === null) { // Probably running in a fork echo "::warning:: No token provided, skipping ping\n"; @@ -56,6 +57,10 @@ $data[explode('=', $pair)[0]] = explode('=', $pair)[1]; } +$data['commit'] = shell_exec('git rev-parse HEAD'); +$data['branch'] = $branch ?? shell_exec('git branch --show-current'); +$data['runner_os'] = php_uname('s'); + curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode($data)); $resp = curl_exec($curl);