Skip to content

chore: update pipeline to trigger only on PRs to dev branch #1

chore: update pipeline to trigger only on PRs to dev branch

chore: update pipeline to trigger only on PRs to dev branch #1

Workflow file for this run

trigger: none
pr:
branches:
include:
- dev
parameters:
- name: "debug"
displayName: "Debug Variables"
type: boolean
default: false
- name: "poolType"
displayName: "Pool Type"
type: string
default: "windows"
values:
- "windows"
- "linux"
- name: "runBrowserTests"
displayName: "Run Browser Tests"
type: boolean
default: true
- name: "runNodeTests"
displayName: "Run Node Tests"
type: boolean
default: true
- name: "runReactTests"
displayName: "Run React Tests"
type: boolean
default: true
- name: "runAngularTests"
displayName: "Run Angular Tests"
type: boolean
default: true
variables:
CDP_DEFINITION_BUILD_COUNT: $[counter('', 0)] # needed for onebranch.pipeline.version task https://aka.ms/obpipelines/versioning
LinuxContainerImage: "mcr.microsoft.com/onebranch/cbl-mariner/build:2.0" # Docker image which is used to build the project https://aka.ms/obpipelines/containers
DEBIAN_FRONTEND: noninteractive
${{ if startsWith(variables['Build.SourceBranch'], 'refs/heads/') }}:
sourceBranch: ${{ replace(variables['Build.SourceBranch'], 'refs/heads/', '') }}
${{ if startsWith(variables['System.PullRequest.SourceBranch'], 'refs/pull/') }}:
sourceBranch: ${{ replace(variables['System.PullRequest.SourceBranch'], 'refs/pull/', '') }}
sourceRepo: "microsoft-authentication-library-for-js"
resources:
repositories:
- repository: templates
type: git
name: OneBranch.Pipelines/GovernedTemplates
ref: refs/heads/main
- repository: 1P
type: git
name: IDDP/msal-javascript-1p
ref: master
extends:
template: v2/OneBranch.NonOfficial.CrossPlat.yml@templates # https://aka.ms/obpipelines/templates
parameters:
globalSdl:
policheck:
break: true
stages:
- stage: e2e_test
displayName: "3P E2E Tests"
jobs:
- ${{ if eq(parameters.runBrowserTests, true) }}:
- template: .pipelines/templates/e2e-tests.yml@1P
parameters:
jobName: "validate_msal_browser"
targetLib: "msal-browser"
poolType: ${{ parameters.poolType }}
stage: "CI"
sourceRepo: ${{ variables.sourceRepo }}
sourceBranch: ${{ variables.sourceBranch }}
workspace: "samples/msal-browser-samples"
samples:
- "client-capabilities"
- "onPageLoad"
- "pop"
- "customizable-e2e-test"
debug: ${{ parameters.debug }}
- ${{ if eq(parameters.runNodeTests, true) }}:
- template: .pipelines/templates/e2e-tests.yml@1P
parameters:
jobName: "validate_msal_node"
targetLib: "msal-node"
poolType: ${{ parameters.poolType }}
stage: "CI"
sourceRepo: ${{ variables.sourceRepo }}
sourceBranch: ${{ variables.sourceBranch }}
workspace: "samples/msal-node-samples"
nodeVersions: [16, 18, 20, 22]
samples:
- "auth-code"
- "auth-code-cli-app"
- "client-credentials"
- "client-credentials-with-cert-from-key-vault"
- "device-code"
- "silent-flow"
- "b2c-user-flows"
# - "on-behalf-of"
debug: ${{ parameters.debug }}
- ${{ if eq(parameters.runReactTests, true) }}:
- template: .pipelines/templates/e2e-tests.yml@1P
parameters:
jobName: "validate_msal_react"
targetLib: "msal-react"
poolType: ${{ parameters.poolType }}
stage: "CI"
sourceRepo: ${{ variables.sourceRepo }}
sourceBranch: ${{ variables.sourceBranch }}
workspace: "samples/msal-react-samples"
samples:
- "nextjs-sample"
- "react-router-sample"
- "typescript-sample"
- "b2c-sample"
debug: ${{ parameters.debug }}
- ${{ if eq(parameters.runAngularTests, true) }}:
- template: .pipelines/templates/e2e-tests.yml@1P
parameters:
jobName: "validate_msal_angular"
targetLib: "msal-angular"
poolType: ${{ parameters.poolType }}
stage: "CI"
sourceRepo: ${{ variables.sourceRepo }}
sourceBranch: ${{ variables.sourceBranch }}
workspace: "samples/msal-angular-v3-samples"
samples:
- "angular15-sample-app"
- "angular16-sample-app"
- "angular-b2c-sample-app"
- "angular-standalone-sample"
- "angular17-standalone-sample"
debug: ${{ parameters.debug }}