azure-functions-auth
Version:
Authentication and Authorization for Azure Functions (with OAuth 2.0 and JWT)
138 lines (110 loc) • 3.06 kB
YAML
# Node.js
# Build a general Node.js project with npm.
# Add steps that analyze code, save build artifacts, deploy, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/javascript
trigger:
batch: false
branches:
include:
- master
paths:
include:
- '*'
exclude:
- README.md
jobs:
# https://docs.microsoft.com/en-us/azure/devops/pipelines/caching/index?view=azure-devops
- job: warm_cache
displayName: 'Warm Cache'
continueOnError: false
pool:
vmImage: 'ubuntu-latest'
variables:
npm_config_cache: $(Pipeline.Workspace)/.npm
steps:
- task: NodeTool@0
inputs:
versionSpec: '10.x'
displayName: 'Install Node.js'
- task: CacheBeta@0
inputs:
key: npm | $(Agent.OS) | package-lock.json
path: $(npm_config_cache)
displayName: 'Cache npm modules'
- script: npm ci
- job: unit_tests
displayName: 'Unit Tests'
dependsOn: warm_cache
condition: succeeded()
continueOnError: false
strategy:
matrix:
linux-node-10:
imageName: 'ubuntu-latest'
nodeVersion: '10.x'
linux-node-latest:
imageName: 'ubuntu-latest'
nodeVersion: '>=12.x'
mac-node-10:
imageName: 'macos-latest'
nodeVersion: '10.x'
mac-node-latest:
imageName: 'macos-latest'
nodeVersion: '>=12.x'
windows-node-10:
imageName: 'windows-latest'
nodeVersion: '10.x'
windows-node-latest:
imageName: 'windows-latest'
nodeVersion: '>=12.x'
pool:
vmImage: $(imageName)
steps:
- task: NodeTool@0
inputs:
versionSpec: $(nodeVersion)
displayName: 'Install Node.js'
- script: |
npm ci
npm test
displayName: 'npm install and test'
- job: build
displayName: 'Build'
dependsOn: unit_tests
condition: succeeded()
continueOnError: false
pool:
vmImage: 'ubuntu-latest'
steps:
- task: NodeTool@0
inputs:
versionSpec: '10.x'
displayName: 'Install Node.js'
- script: |
npm ci
npm run compile
displayName: 'npm install and compile'
- job: integration_tests
displayName: 'Integration Tests'
dependsOn: build
condition: succeeded()
continueOnError: false
pool:
vmImage: 'ubuntu-latest'
steps:
- task: NodeTool@0
inputs:
versionSpec: '10.x'
displayName: 'Install Node.js'
- script: |
npm ci
npm run test-integrations
env:
AUTH_M2M_CLIENT_SECRET_AUTH0: $(AUTH_M2M_CLIENT_SECRET_AUTH0)
AUTH_FUNCTIONS_KEY: $(AUTH_FUNCTIONS_KEY)
displayName: 'npm run test-integrations'
# Pipeline.Workspace variable. Under this, various sub-directories are created:
# Build.SourcesDirectory is where tasks download the application's source code.
# Build.ArtifactStagingDirectory is where tasks download artifacts needed for the pipeline or upload artifacts before they are published.
# Build.BinariesDirectory is where tasks write their outputs.
# Build.TestResultsDirectory is where tasks upload their test results.