Last active
July 26, 2023 12:14
-
-
Save corradin/1b2db5c54f85c818f093ddd028351bd7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
trigger: | |
- main | |
pool: | |
vmImage: ubuntu-latest | |
variables: | |
npm_config_cache: $(Pipeline.Workspace)/.npm | |
steps: | |
- task: Cache@2 | |
inputs: | |
key: 'package-lock.json' | |
path: $(npm_config_cache) | |
displayName: Cache NPM packages | |
- script: npm ci --cache $(npm_config_cache) | |
displayName: NPM Install Dependencies | |
- script: | | |
npm cache ls | |
npm cache verify | |
displayName: NPM Show cache | |
- script: npm run lint | |
displayName: Lint | |
- script: npm run test:ci | |
displayName: Unit Tests | |
- script: npm run build | |
displayName: Build |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Read the blog, thanks for making this available!
Is the
--cache
flag necessary, or done to make the caching location more explicit? During my search to resolve some npm caching issues in our pipeline I came across this comment that environment variables are automatically read by npm, and the azure docs don't include the flag.