Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .github/workflows/build_reusable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,11 @@ on:
required: false
type: string
default: ''
testReportsArtifactPrefix:
description: 'Artifact name prefix for uploading test `*.results.json` files. Empty string disables upload.'
required: false
type: string
default: ''

browser:
description: 'Browser to use for tests'
Expand Down Expand Up @@ -318,6 +323,15 @@ jobs:
shell: bash -le {0}
timeout-minutes: ${{ inputs.timeout_minutes }}

- name: Upload test result artifacts
if: ${{ inputs.testReportsArtifactPrefix != '' && inputs.afterBuild && always() }}
uses: actions/upload-artifact@v4
with:
name: ${{ inputs.testReportsArtifactPrefix }}-${{ steps.var.outputs.input_step_key }}
path: test/**/*.results.json
if-no-files-found: ignore
retention-days: 1

# This file messes up the tests because it influences the build root autodetection.
# Jest has a global cache, so PRs that poison the cache can bring down CI
- name: Clean up stray files
Expand Down
48 changes: 48 additions & 0 deletions .github/workflows/test_e2e_deploy_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ jobs:
skipNativeBuild: 'yes'
skipNativeInstall: 'no'
stepName: 'test-deploy-deploy-${{ matrix.group }}'
testReportsArtifactPrefix: 'adapter-test-reports'
timeout_minutes: 180
runs_on_labels: '["ubuntu-latest"]'
overrideProxyAddress: ${{ inputs.overrideProxyAddress || '' }}
Expand All @@ -245,6 +246,53 @@ jobs:
DD_ENV=ci npx @datadog/datadog-ci@2.23.1 junit upload --tags test.type:deploy --service nextjs ./test/test-junit-report
fi

upload-adapter-test-results:
name: Upload adapter test results
needs: [test-deploy-adapter]
if: ${{ always() && github.event.inputs.deployScriptPath == '' && github.repository_owner == 'vercel' }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20.9.0
check-latest: true

- name: Download adapter test result artifacts
continue-on-error: true
uses: actions/download-artifact@v4
with:
pattern: adapter-test-reports-*
path: adapter-test-results
merge-multiple: true

- name: Upload adapter test results
run: |
if [ -z "${ADAPTER_TEST_RESULTS_SECRET:-}" ]; then
echo "ADAPTER_TEST_RESULTS_SECRET is not configured, skipping upload"
exit 0
fi

if [ ! -d adapter-test-results ]; then
echo "No adapter test artifact directory found, skipping upload"
exit 0
fi

if ! find adapter-test-results -type f -name '*.results.json' | grep -q .; then
echo "No adapter .results.json files found, skipping upload"
exit 0
fi

node scripts/upload-adapter-test-results.mjs \
--results-root adapter-test-results \
--provider vercel \
--commit-sha "${{ github.sha }}"
env:
ADAPTER_TEST_RESULTS_SECRET: ${{ secrets.ADAPTER_TEST_RESULTS_SECRET }}

create-draft-prs:
name: Immediately open draft prs
needs: setup
Expand Down
Loading
Loading