diff --git a/.github/actions/mergify-insights/action.yml b/.github/actions/mergify-insights/action.yml new file mode 100644 index 00000000000..ef31eae4b58 --- /dev/null +++ b/.github/actions/mergify-insights/action.yml @@ -0,0 +1,27 @@ +--- +name: mergify-insights +description: upload test results to Mergify + +inputs: + token: + description: 'The mergify token' + required: true + job_name: + description: 'The name of the job' + required: false + default: ${{ github.job }} + +runs: + using: composite + steps: + - run: | + go install github.com/jstemmer/go-junit-report@latest + cat test.output | go-junit-report > junit.xml + shell: bash + - name: Mergify CI Upload + if: (success() || failure()) && github.event_name != 'pull_request' || ( github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork == false ) + uses: mergifyio/gha-mergify-ci@6875ab3991ec1db831576df1cd00a7870603aa9e # v8 + with: + token: ${{ inputs.token }} + report_path: junit.xml + job_name: ${{ inputs.job_name }} diff --git a/.github/workflows/ci-insights.yml b/.github/workflows/ci-insights.yml new file mode 100644 index 00000000000..5e0af94d254 --- /dev/null +++ b/.github/workflows/ci-insights.yml @@ -0,0 +1,39 @@ +name: ci-insights + +on: + push: + branches: + - "feature/gh-test-reports-insights" + schedule: + - cron: '0 */3 * * *' + workflow_dispatch: + +permissions: + contents: read + +jobs: + unit-tests: + strategy: + fail-fast: false + matrix: + os: [ ubuntu-latest, macos-latest, windows-latest ] + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v5 + + - uses: actions/setup-go@v6 + with: + go-version-file: .go-version + + - name: Install make + if: runner.os == 'macOS' + run: | + brew install make + export PATH="/usr/local/opt/make/libexec/gnubin:$PATH" + + - run: go test -v -race ./... 2>&1 | tee test.output + + - uses: ./.github/actions/mergify-insights + with: + job_name: ${{ github.job }}-${{ matrix.os }} + token: ${{ secrets.MERGIFY_TOKEN }}