Atom/script/vsts/platforms/linux.yml

100 lines
3.7 KiB
YAML

jobs:
- job: Linux
dependsOn: GetReleaseVersion
timeoutInMinutes: 180
variables:
ReleaseVersion: $[ dependencies.GetReleaseVersion.outputs['Version.ReleaseVersion'] ]
pool:
# This image is used to host the Docker container that runs the build
vmImage: ubuntu-16.04
container: atom-linux-ci
steps:
- task: NodeTool@0
inputs:
versionSpec: 10.2.1
displayName: Install Node.js 10.2.1
- script: npm install --global npm@6.2.0
displayName: Update npm
- task: 1ESLighthouseEng.PipelineArtifactCaching.RestoreCacheV1.RestoreCache@1
displayName: Restore node_modules cache
inputs:
keyfile: 'package.json, script/vsts/platforms/linux.yml, **/package-lock.json, !**/node_modules/**/package-lock.json, !**/.*/**/package-lock.json'
targetfolder: '**/node_modules, !**/node_modules/**/node_modules'
vstsFeed: 'bae1bc26-220d-43c7-a955-4de039370de2'
- script: script/bootstrap
displayName: Bootstrap build environment
env:
CI: true
CI_PROVIDER: VSTS
condition: ne(variables['CacheRestored'], 'true')
- task: 1ESLighthouseEng.PipelineArtifactCaching.SaveCacheV1.SaveCache@1
displayName: Save node_modules cache
inputs:
keyfile: 'package.json, script/vsts/platforms/linux.yml, **/package-lock.json, !**/node_modules/**/package-lock.json, !**/.*/**/package-lock.json'
targetfolder: '**/node_modules, !**/node_modules/**/node_modules'
vstsFeed: 'bae1bc26-220d-43c7-a955-4de039370de2'
- script: script/lint
displayName: Run linter
- script: script/build --no-bootstrap --create-debian-package --create-rpm-package --compress-artifacts
env:
GITHUB_TOKEN: $(GITHUB_TOKEN)
ATOM_RELEASE_VERSION: $(ReleaseVersion)
displayName: Build Atom
- script: script/test
env:
CI: true
CI_PROVIDER: VSTS
ATOM_JASMINE_REPORTER: list
TEST_JUNIT_XML_ROOT: $(Common.TestResultsDirectory)/junit
displayName: Run tests
condition: and(succeeded(), ne(variables['Atom.SkipTests'], 'true'))
- script: script/postprocess-junit-results --search-folder "${TEST_JUNIT_XML_ROOT}" --test-results-files "**/*.xml"
env:
TEST_JUNIT_XML_ROOT: $(Common.TestResultsDirectory)/junit
displayName: Post-process test results
condition: ne(variables['Atom.SkipTests'], 'true')
- task: PublishTestResults@2
inputs:
testResultsFormat: JUnit
searchFolder: $(Common.TestResultsDirectory)/junit
testResultsFiles: '**/*.xml'
mergeTestResults: true
testRunTitle: Linux
condition: ne(variables['Atom.SkipTests'], 'true')
- task: PublishBuildArtifacts@1
inputs:
PathtoPublish: $(Build.SourcesDirectory)/out/atom.x86_64.rpm
ArtifactName: atom.x86_64.rpm
ArtifactType: Container
displayName: Upload atom.x84_64.rpm
condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest'))
- task: PublishBuildArtifacts@1
inputs:
PathtoPublish: $(Build.SourcesDirectory)/out/atom-amd64.deb
ArtifactName: atom-amd64.deb
ArtifactType: Container
displayName: Upload atom-amd64.deb
condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest'))
- task: PublishBuildArtifacts@1
inputs:
PathtoPublish: $(Build.SourcesDirectory)/out/atom-amd64.tar.gz
ArtifactName: atom-amd64.tar.gz
ArtifactType: Container
displayName: Upload atom-amd64.tar.gz
condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest'))