forked from isomorphic-git/isomorphic-git
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
84 lines (72 loc) · 3.34 KB
/
azure-pipelines.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
# Node.js
# Build a general Node.js application with npm.
# Add steps that analyze code, save build artifacts, deploy, and more:
# https://docs.microsoft.com/vsts/pipelines/languages/javascript
jobs:
- job: Linux
pool:
vmImage: 'ubuntu-20.04'
# Most pipelines finish in under 15 minutes. 30 minutes should be more than enough.
# See https://dev.azure.com/isomorphic-git/isomorphic-git/_pipeline/analytics/duration.
timeoutInMinutes: 30
steps:
- task: NodeTool@0
inputs:
versionSpec: '12.x'
displayName: 'Install Node.js'
- task: 1ESLighthouseEng.PipelineArtifactCaching.RestoreAndSaveCacheV1.RestoreAndSaveCache@1
inputs:
keyfile: 'package-lock.json'
targetfolder: 'node_modules'
vstsFeed: $(ARTIFACT_FEED)
- script: npm ci
displayName: 'Install dependencies'
condition: ne(variables['CacheRestored'], 'true')
- script: npm test
displayName: 'Run tests'
env:
BROWSER_STACK_ACCESS_KEY: $(BROWSER_STACK_ACCESS_KEY)
BROWSER_STACK_USERNAME: $(BROWSER_STACK_USERNAME)
BUNDLEWATCH_GITHUB_TOKEN: $(BUNDLEWATCH_GITHUB_TOKEN)
SAUCE_ACCESS_KEY: $(SAUCE_ACCESS_KEY)
SAUCE_USERNAME: $(SAUCE_USERNAME)
TEST_BROWSERS: 'ChromeHeadlessNoSandbox,FirefoxHeadless,sl_edge,sl_safari,sl_ios_safari,bs_android_chrome'
- task: PublishTestResults@2
displayName: 'Save test results'
condition: succeededOrFailed()
inputs:
testResultsFormat: JUnit
testResultsFiles: '$(System.DefaultWorkingDirectory)/junit/*.xml'
- task: PublishCodeCoverageResults@1
displayName: 'Save code coverage'
condition: and(succeededOrFailed(), ne(variables['system.pullrequest.isfork'], true))
inputs:
codeCoverageTool: Cobertura
summaryFileLocation: '$(System.DefaultWorkingDirectory)/coverage/cobertura-coverage.xml'
reportDirectory: '$(System.DefaultWorkingDirectory)/coverage/lcov-report'
- task: PublishBuildArtifacts@1
displayName: 'Save npm-tarball.tgz'
condition: and(succeededOrFailed(), ne(variables['system.pullrequest.isfork'], true))
inputs:
artifactName: 'npm-tarball.tgz'
PathtoPublish: '$(System.DefaultWorkingDirectory)/isomorphic-git-0.0.0-development.tgz'
- task: PublishBuildArtifacts@1
displayName: 'Save index.umd.min.js'
condition: and(succeededOrFailed(), ne(variables['system.pullrequest.isfork'], true))
inputs:
artifactName: 'index.umd.min.js'
PathtoPublish: '$(System.DefaultWorkingDirectory)/index.umd.min.js'
- script: npm run semantic-release
displayName: 'Publish to npm'
condition: and(succeeded(), or(eq(variables['Build.SourceBranch'], 'refs/heads/main'), eq(variables['Build.SourceBranch'], 'refs/heads/beta')))
env:
GH_TOKEN: $(GITHUB_TOKEN)
NPM_TOKEN: $(Npm.Token)
TWITTER_ACCESS_TOKEN_SECRET: $(TWITTER_ACCESS_TOKEN_SECRET)
TWITTER_CONSUMER_SECRET: $(TWITTER_CONSUMER_SECRET)
- script: npm run publish-website
displayName: 'Update website'
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/main'))
env:
GITHUB_TOKEN: $(GITHUB_TOKEN)
NPM_TOKEN: $(Npm.Token)