From db35774f9f84fd8bfeccf543dfffa7c9ba6b80a8 Mon Sep 17 00:00:00 2001 From: Jake Bailey <5341706+jakebailey@users.noreply.github.com> Date: Fri, 29 Mar 2024 15:24:49 -0700 Subject: [PATCH] Avoid testing in same CI jobs as releases (#58002) --- .github/workflows/insiders.yaml | 24 +++++++++++++++++++++--- .github/workflows/nightly.yaml | 23 ++++++++++++++++++++--- azure-pipelines.release.yml | 26 ++++++++++++++++++++++++-- 3 files changed, 65 insertions(+), 8 deletions(-) diff --git a/.github/workflows/insiders.yaml b/.github/workflows/insiders.yaml index 6a924050645..7208117d27e 100644 --- a/.github/workflows/insiders.yaml +++ b/.github/workflows/insiders.yaml @@ -15,7 +15,27 @@ defaults: shell: bash jobs: - build: + test: + runs-on: ubuntu-latest + if: github.repository == 'microsoft/TypeScript' + + steps: + - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + - uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2 + - run: | + npm --version + # corepack enable npm + npm install -g $(jq -r '.packageManager' < package.json) + npm --version + - name: Test insiders + run: | + npm ci + npx hereby configure-insiders + npm test + + publish: + needs: test + runs-on: ubuntu-latest if: github.repository == 'microsoft/TypeScript' @@ -36,8 +56,6 @@ jobs: npm ci npx hereby configure-insiders npx hereby LKG - npx hereby runtests-parallel - npx hereby clean npm publish --tag insiders env: NODE_AUTH_TOKEN: ${{secrets.npm_token}} diff --git a/.github/workflows/nightly.yaml b/.github/workflows/nightly.yaml index f79062c435c..3f8d6d2efe0 100644 --- a/.github/workflows/nightly.yaml +++ b/.github/workflows/nightly.yaml @@ -16,7 +16,26 @@ defaults: shell: bash jobs: - build: + test: + runs-on: ubuntu-latest + if: github.repository == 'microsoft/TypeScript' + + steps: + - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + - uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2 + - run: | + npm --version + # corepack enable npm + npm install -g $(jq -r '.packageManager' < package.json) + npm --version + - name: Setup and publish nightly + run: | + npm ci + npx hereby configure-nightly + npm test + + publish: + needs: [test] runs-on: ubuntu-latest if: github.repository == 'microsoft/TypeScript' @@ -37,8 +56,6 @@ jobs: npm ci npx hereby configure-nightly npx hereby LKG - npx hereby runtests-parallel - npx hereby clean npm publish --tag next env: NODE_AUTH_TOKEN: ${{secrets.npm_token}} diff --git a/azure-pipelines.release.yml b/azure-pipelines.release.yml index fc0f05d65eb..54684eafbbb 100644 --- a/azure-pipelines.release.yml +++ b/azure-pipelines.release.yml @@ -28,8 +28,8 @@ extends: - stage: buildStage displayName: Build Stage jobs: - - job: build - displayName: Build + - job: test + displayName: Test steps: - checkout: self clean: true @@ -52,6 +52,28 @@ extends: - script: 'npm test' displayName: 'npm test' + - job: build + displayName: Build + dependsOn: test + steps: + - checkout: self + clean: true + fetchDepth: 1 + fetchTags: false + + - task: NodeTool@0 + inputs: + versionSpec: 20.x + displayName: 'Install Node' + + - script: | + npm install -g `node -e 'console.log(JSON.parse(fs.readFileSync("package.json", "utf8")).packageManager)'` + npm --version + displayName: 'Install packageManager from package.json' + + - script: npm ci + displayName: 'npm ci' + - script: | npx hereby LKG npx hereby clean