Skip to content
Open
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
68 changes: 68 additions & 0 deletions .azdo/azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# Azure Pipelines equivalent of .github/workflows/build-test-lint.yml

trigger:
branches:
include:
- main

pr:
branches:
include:
- '*'

# Manual trigger support
schedules: []

pool:
vmImage: 'ubuntu-latest'

steps:
- checkout: self
clean: true

- task: NodeTool@0
displayName: 'Use Node.js 23.x'
inputs:
versionSpec: '23.x'

- script: echo "registry=https://pkgs.dev.azure.com/dynamicscrm/OneCRM/_packaging/DPX-Tools-Upstream/npm/registry/" > .npmrc
displayName: 'Set NPM registry'

- task: npmAuthenticate@0
inputs:
workingFile: .npmrc

- task: Npm@1
inputs:
command: ci
customRegistry: useFeed
customFeed: OneCRM/DPX-Tools-Upstream
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should use our one feed, not this one

verbose: true
workingDir: .
displayName: 'npm ci'

- script: npm run lint
displayName: 'Lint'

- script: npm run build
displayName: 'Build'

- script: npm run test
displayName: 'Test'

- script: |
mkdir -p $(Build.ArtifactStagingDirectory)/packages
for dir in packages/* external/*; do
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: why do we have a tree here? can we flat the source tree under packages?

Also, I'd suggest to use npm workspaces, so we can run single commands from the root

if [ -d "$dir" ] && [ -f "$dir/package.json" ]; then
echo "Packing $dir..."
(cd "$dir" && npm pack --pack-destination $(Build.ArtifactStagingDirectory)/packages)
fi
done
displayName: 'Pack artifacts'

- task: PublishBuildArtifacts@1
inputs:
pathToPublish: '$(Build.ArtifactStagingDirectory)/packages'
artifactName: 'npm-packages'
publishLocation: 'Container'
displayName: 'Publish package artifacts'
15 changes: 0 additions & 15 deletions scripts/validate-snippets.js

This file was deleted.