Unverified Commit c0faca2d authored by JJ Kasper's avatar JJ Kasper Committed by GitHub

Update CNA tests running (#44577)

Updates to only run the create-next-app tests for PRs when the related
package files change, continues to always run on canary though.
parent 4e879ec3
......@@ -475,6 +475,52 @@ jobs:
# public: true
# filter: ${{ 'function($v) { $v.metadata.test.result = "failed" }' }}
testCNA:
name: Test Create Next App
runs-on: ubuntu-latest
needs: [build, build-native-test]
timeout-minutes: 35
env:
NEXT_TELEMETRY_DISABLED: 1
NEXT_TEST_JOB: 1
TEST_TIMINGS_TOKEN: ${{ secrets.TEST_TIMINGS_TOKEN || secrets.GITHUB_TOKEN }}
steps:
- run: echo ${{needs.build.outputs.docsChange}}
# https://github.com/actions/virtual-environments/issues/1187
- name: tune linux network
run: sudo ethtool -K eth0 tx off rx off
- uses: actions/cache@v3
if: ${{ needs.build.outputs.docsChange == 'nope' }}
id: restore-build
with:
path: ./*
key: ${{ github.sha }}-${{ github.run_number }}
- uses: actions/download-artifact@v3
if: ${{ needs.build.outputs.docsChange == 'nope' }}
with:
name: next-swc-test-binary
path: packages/next-swc/native
- run: echo "::set-output name=CNA_CHANGE::$(node scripts/run-for-change.js --type cna --always-canary --exec echo 'yup')"
id: cna-change
- run: docker run --rm -v $(pwd):/work mcr.microsoft.com/playwright:v1.28.1-focal /bin/bash -c "cd /work && ls && curl https://install-node.vercel.app/v16 | FORCE=1 bash && node -v && npm i -g pnpm@${PNPM_VERSION} && xvfb-run node run-tests.js test/integration/create-next-app/index.test.ts test/integration/create-next-app/templates.test.ts >> /proc/1/fd/1"
if: ${{ needs.build.outputs.docsChange == 'nope' && steps.cna-change.outputs.CNA_CHANGE == 'yup' }}
- name: Upload test trace
if: always()
uses: actions/upload-artifact@v3
with:
name: test-trace
if-no-files-found: ignore
retention-days: 2
path: |
test/traces
testIntegration:
name: Test Integration
runs-on: ubuntu-latest
......
......@@ -18,6 +18,7 @@ const CHANGE_ITEM_GROUPS = {
'.github/labeler.json',
'.github/pull_request_template.md',
],
cna: ['packages/create-next-app'],
'next-swc': ['packages/next-swc', 'scripts/normalize-version-bump.js'],
}
......@@ -64,6 +65,7 @@ async function main() {
const typeIndex = process.argv.indexOf('--type')
const type = typeIndex > -1 && process.argv[typeIndex + 1]
const isNegated = process.argv.indexOf('--not') > -1
const alwaysCanary = process.argv.includes('--always-canary') > -1
if (!type) {
throw new Error(
......@@ -92,6 +94,12 @@ async function main() {
}
let changedFilesCount = 0
// always run for canary if flag is enabled
if (alwaysCanary && branchName === 'canary') {
changedFilesCount += 1
hasMatchingChange = true
}
for (let file of changedFilesOutput.split('\n')) {
file = file.trim().replace(/\\/g, '/')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment