diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 706f5787ed0..96aeb1b55c7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -46,6 +46,7 @@ jobs: strategy: matrix: os: ['macos-latest', 'ubuntu-latest', 'windows-2025'] + fail-fast: false runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v5 @@ -61,7 +62,11 @@ jobs: key: go-${{ hashFiles('go.mod') }} restore-keys: | go- - - run: go test -v -race ./... + - run: go test -v -race ./... 2>&1 | tee test.output + - uses: ./.github/workflows/test-report + with: + job_name: ${{ github.job }}-${{ matrix.os }} + token: ${{ secrets.MERGIFY_TOKEN }} test-integration-server-internal: runs-on: ubuntu-latest @@ -87,7 +92,10 @@ jobs: EC_REGION: "gcp-us-west2" # run integrationservertest/internal tests # integrationservertest themselves are run in the integration-server-test pipeline - run: cd ./integrationservertest && go test -v -race ./internal/... + run: cd ./integrationservertest && go test -v -race ./internal/... 2>&1 | tee ../test.output + - uses: ./.github/workflows/test-report + with: + token: ${{ secrets.MERGIFY_TOKEN }} test-fips: runs-on: ubuntu-latest @@ -108,7 +116,10 @@ jobs: GOFIPS140: "latest" # TODO: disable X25519MLKEM768 until upstream go issue is fixed https://github.com/golang/go/issues/74630#issuecomment-3224191006 GODEBUG: "fips140=only,tlsmlkem=0" - run: go test -v -race -tags=requirefips ./... + run: go test -v -race -tags=requirefips ./... 2>&1 | tee test.output + - uses: ./.github/workflows/test-report + with: + token: ${{ secrets.MERGIFY_TOKEN }} system-test: runs-on: ubuntu-latest @@ -130,6 +141,9 @@ jobs: GOTESTFLAGS: "-v" GH_TOKEN: ${{ github.token }} run: make system-test + - uses: ./.github/workflows/test-report + with: + token: ${{ secrets.MERGIFY_TOKEN }} system-test-fips: runs-on: ubuntu-latest @@ -154,6 +168,9 @@ jobs: GODEBUG: "fips140=only,tlsmlkem=0" GH_TOKEN: ${{ github.token }} run: make system-test + - uses: ./.github/workflows/test-report + with: + token: ${{ secrets.MERGIFY_TOKEN }} test-package: runs-on: ubuntu-latest diff --git a/.github/workflows/test-report/action.yml b/.github/workflows/test-report/action.yml new file mode 100644 index 00000000000..95c6aee69a9 --- /dev/null +++ b/.github/workflows/test-report/action.yml @@ -0,0 +1,39 @@ +--- +name: test-report +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 | tee "junit-${job_name}.xml" + shell: bash + env: + job_name: ${{ inputs.job_name }} + + - uses: actions/upload-artifact@v4 + with: + name: junit-${{ inputs.job_name }} + path: "junit-${{ inputs.job_name }}.xml" + if-no-files-found: error + + - 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 }} + # NOTE: only for testing Mergify CI insights + env: + GITHUB_REF_NAME: main diff --git a/Makefile b/Makefile index ac676d6e583..250d3c0ef66 100644 --- a/Makefile +++ b/Makefile @@ -131,7 +131,7 @@ test: system-test: # CGO is disabled when building APM Server binary, so the race detector in this case # would only work on the parts that don't involve APM Server binary. - @(cd systemtest; go test $(GOMODFLAG) $(GOTESTFLAGS) -race -timeout=20m ./...) + @(cd systemtest; go test $(GOMODFLAG) $(GOTESTFLAGS) -race -timeout=20m ./... 2>&1 | tee ../test.output) .PHONY: clean: