forked from atom/atom
-
Notifications
You must be signed in to change notification settings - Fork 31
CI templates #46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
CI templates #46
Changes from all commits
Commits
Show all changes
31 commits
Select commit
Hold shift + click to select a range
deabf83
move cache.yml to templates folder
aminya 9f406e2
windows-preparation.yml
aminya 3127fa5
windows-test.yml
aminya 4d6855f
windows-bootstrap.yml
aminya 7a4c8c6
windows-build.yml and windows-publish.yml
aminya ee3022b
macos-preparation.yml
aminya f0074f5
macos-bootstrap.yml
aminya bf06d17
macos-build.yml and macos-publish.yml
aminya b5bf759
macos-test.yml
aminya 1fe38af
linux-preparation.yml
aminya cf0c4a7
linux-bootstrap.yml
aminya df3e80a
linux-test.yml
aminya 91f302f
linux-build.yml and linux-publish.yml
aminya 264fdd4
combine publish for all OS
aminya 443c98e
combine bootstrap for all OS
aminya da793c9
download-unzip.yml
aminya 309e3c0
Update bootstrap.yml
aminya 379f780
Merge pull request #45 from atom-ide-community/GitHub-token-no-rate-l…
aminya 4e4a6e0
combine preparation for all OS
aminya f113939
Use pwsh
aminya e74543a
Remove linux container and use clang 9
aminya 7101119
combine build for all OS
aminya 9a3112c
combine test for all OS
aminya b0aa6c6
using AGENT_OS directly
aminya 225fb5b
build: using pwsh for managing env variables
aminya e95af73
bootstrap: using pwsh for managing env variables
aminya 3da79e3
test: using pwsh for managing env variables
aminya 7c63d85
using pwsh for setting FileID
aminya 5f5b93b
set BUILD_ARCH in preparation
aminya 2d7a8df
using templates in nightly-release.yml
aminya ef45a89
using templates in release-branch-build.yml
aminya File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,10 +35,7 @@ jobs: | |
ReleaseVersion: $[ dependencies.GetReleaseVersion.outputs['Version.ReleaseVersion'] ] | ||
|
||
steps: | ||
- task: NodeTool@0 | ||
inputs: | ||
versionSpec: 12.13.1 | ||
displayName: Install Node.js 12.13.1 | ||
- template: platforms/templates/preparation.yml | ||
|
||
#This has to be done separately because VSTS inexplicably | ||
#exits the script block after `npm install` completes. | ||
|
@@ -74,23 +71,15 @@ jobs: | |
vmImage: macos-10.14 | ||
|
||
steps: | ||
- task: NodeTool@0 | ||
inputs: | ||
versionSpec: 12.13.1 | ||
displayName: Install Node.js 12.13.1 | ||
- template: platforms/templates/preparation.yml | ||
|
||
- script: npm install --global [email protected] | ||
displayName: Update npm | ||
- template: platforms/templates/bootstrap.yml | ||
|
||
- script: | | ||
script/bootstrap | ||
displayName: Bootstrap | ||
|
||
- script: | | ||
- script: | | ||
cd script/lib | ||
npm install | ||
displayName: npm install | ||
- script: | | ||
- script: | | ||
cd script/lib/update-dependency | ||
node index.js | ||
displayName: Bump depedencies | ||
|
This file contains hidden or 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,105 +7,32 @@ jobs: | |
pool: | ||
# This image is used to host the Docker container that runs the build | ||
vmImage: ubuntu-16.04 | ||
container: ubuntu:trusty | ||
|
||
steps: | ||
- script: | | ||
sudo apt-get update | ||
sudo apt-get install -y wget software-properties-common | ||
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - | ||
sudo apt-add-repository "deb http://apt.llvm.org/trusty/ llvm-toolchain-trusty-5.0 main" | ||
sudo apt-get update | ||
sudo apt-get install -y build-essential ca-certificates clang-5.0 xvfb fakeroot git libsecret-1-dev rpm libx11-dev libxkbfile-dev xz-utils xorriso zsync libxss1 libgconf2-4 libgtk-3-0 libasound2 libicu-dev | ||
displayName: Install apt dependencies | ||
- template: templates/preparation.yml | ||
|
||
- script: sudo /sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -ac -screen 0 1280x1024x16 | ||
displayName: Start Xvfb | ||
|
||
- task: NodeTool@0 | ||
inputs: | ||
versionSpec: 12.13.1 | ||
displayName: Install Node.js 12.13.1 | ||
|
||
- script: npm install --global [email protected] | ||
displayName: Update npm | ||
|
||
- template: cache.yml | ||
- template: templates/cache.yml | ||
parameters: | ||
OS: linux | ||
|
||
- script: script/bootstrap | ||
displayName: Bootstrap build environment | ||
env: | ||
CI: true | ||
CI_PROVIDER: VSTS | ||
CC: clang-5.0 | ||
CXX: clang++-5.0 | ||
npm_config_clang: 1 | ||
condition: or(ne(variables['MainNodeModulesRestored'], 'true'), ne(variables['ScriptNodeModulesRestored'], 'true'), ne(variables['ApmNodeModulesRestored'], 'true')) | ||
- template: templates/bootstrap.yml | ||
|
||
- 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) | ||
CC: clang-5.0 | ||
CXX: clang++-5.0 | ||
npm_config_clang: 1 | ||
displayName: Build Atom | ||
|
||
- script: | | ||
sudo chown root ./out/atom*-amd64/chrome-sandbox | ||
sudo chmod 4755 ./out/atom*-amd64/chrome-sandbox | ||
displayName: Tweaking chrome-sandbox binary | ||
|
||
- script: script/test | ||
env: | ||
CI: true | ||
CI_PROVIDER: VSTS | ||
ATOM_JASMINE_REPORTER: list | ||
TEST_JUNIT_XML_ROOT: $(Common.TestResultsDirectory)/junit | ||
DISPLAY: :99.0 | ||
displayName: Run tests | ||
condition: and(succeeded(), ne(variables['Atom.SkipTests'], 'true')) | ||
- template: templates/build.yml | ||
|
||
- 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') | ||
- template: templates/test.yml | ||
|
||
- 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')) | ||
- template: templates/publish.yml | ||
parameters: | ||
artifacts: | ||
- filename: atom.x86_64.rpm | ||
dir: $(Build.SourcesDirectory)/out | ||
condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest')) | ||
- filename: atom-amd64.deb | ||
dir: $(Build.SourcesDirectory)/out | ||
condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest')) | ||
- filename: atom-amd64.tar.gz | ||
dir: $(Build.SourcesDirectory)/out | ||
condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest')) |
This file contains hidden or 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,76 +12,35 @@ jobs: | |
vmImage: macos-10.14 | ||
|
||
steps: | ||
- task: NodeTool@0 | ||
inputs: | ||
versionSpec: 12.13.1 | ||
displayName: Install Node.js 12.13.1 | ||
- template: templates/preparation.yml | ||
|
||
- script: npm install --global [email protected] | ||
displayName: Update npm | ||
|
||
- template: cache.yml | ||
- template: templates/cache.yml | ||
parameters: | ||
OS: macos | ||
|
||
- script: script/bootstrap | ||
displayName: Bootstrap build environment | ||
env: | ||
CI: true | ||
CI_PROVIDER: VSTS | ||
NPM_BIN_PATH: /usr/local/bin/npm | ||
npm_config_build_from_source: true | ||
condition: or(ne(variables['MainNodeModulesRestored'], 'true'), ne(variables['ScriptNodeModulesRestored'], 'true'), ne(variables['ApmNodeModulesRestored'], 'true')) | ||
- template: templates/bootstrap.yml | ||
|
||
- script: script/lint | ||
displayName: Run linter | ||
|
||
- script: | | ||
if [ $SHOULD_SIGN == "true" ] && ([ $IS_RELEASE_BRANCH == "true" ] || [ $IS_SIGNED_ZIP_BRANCH == "true" ]); then | ||
script/build --no-bootstrap --code-sign --compress-artifacts | ||
else | ||
script/build --no-bootstrap --compress-artifacts | ||
fi | ||
displayName: Build Atom | ||
env: | ||
GITHUB_TOKEN: $(GITHUB_TOKEN) | ||
IS_RELEASE_BRANCH: $(IsReleaseBranch) | ||
IS_SIGNED_ZIP_BRANCH: $(IsSignedZipBranch) | ||
ATOM_RELEASE_VERSION: $(ReleaseVersion) | ||
ATOM_MAC_CODE_SIGNING_CERT_DOWNLOAD_URL: $(ATOM_MAC_CODE_SIGNING_CERT_DOWNLOAD_URL) | ||
ATOM_MAC_CODE_SIGNING_CERT_PASSWORD: $(ATOM_MAC_CODE_SIGNING_CERT_PASSWORD) | ||
ATOM_MAC_CODE_SIGNING_KEYCHAIN: $(ATOM_MAC_CODE_SIGNING_KEYCHAIN) | ||
ATOM_MAC_CODE_SIGNING_KEYCHAIN_PASSWORD: $(ATOM_MAC_CODE_SIGNING_KEYCHAIN_PASSWORD) | ||
AC_USER: $(AC_USER) | ||
AC_PASSWORD: $(AC_PASSWORD) | ||
- template: templates/build.yml | ||
|
||
- script: | | ||
cp $(Build.SourcesDirectory)/out/*.zip $(Build.ArtifactStagingDirectory) | ||
displayName: Stage Artifacts | ||
|
||
- task: PublishBuildArtifacts@1 | ||
inputs: | ||
PathtoPublish: $(Build.ArtifactStagingDirectory)/atom-mac.zip | ||
ArtifactName: atom-mac.zip | ||
ArtifactType: Container | ||
displayName: Upload atom-mac.zip | ||
condition: succeeded() | ||
|
||
- task: PublishBuildArtifacts@1 | ||
inputs: | ||
PathtoPublish: $(Build.ArtifactStagingDirectory)/atom-mac-symbols.zip | ||
ArtifactName: atom-mac-symbols.zip | ||
ArtifactType: Container | ||
displayName: Upload atom-mac-symbols.zip | ||
condition: succeeded() | ||
|
||
- task: PublishBuildArtifacts@1 | ||
inputs: | ||
PathtoPublish: $(Build.SourcesDirectory)/docs/output/atom-api.json | ||
ArtifactName: atom-api.json | ||
ArtifactType: Container | ||
displayName: Upload atom-api.json | ||
condition: succeeded() | ||
- template: templates/publish.yml | ||
parameters: | ||
artifacts: | ||
- filename: atom-mac.zip | ||
dir: $(Build.ArtifactStagingDirectory) | ||
condition: succeeded() | ||
- filename: atom-mac-symbols.zip | ||
dir: $(Build.ArtifactStagingDirectory) | ||
condition: succeeded() | ||
- filename: atom-api.json | ||
dir: $(Build.SourcesDirectory)/docs/output | ||
condition: succeeded() | ||
|
||
- job: macOS_tests | ||
displayName: macOS test | ||
|
@@ -103,84 +62,20 @@ jobs: | |
RunPackageTests: 2 | ||
|
||
steps: | ||
- task: NodeTool@0 | ||
inputs: | ||
versionSpec: 12.13.1 | ||
displayName: Install Node.js 12.13.1 | ||
|
||
- script: npm install --global [email protected] | ||
displayName: Update npm | ||
- template: templates/preparation.yml | ||
|
||
- template: cache.yml | ||
- template: templates/cache.yml | ||
parameters: | ||
OS: macos | ||
|
||
# The artifact caching task does not work on forks, so we need to | ||
# bootstrap again for pull requests coming from forked repositories. | ||
- script: script/bootstrap | ||
displayName: Bootstrap build environment | ||
env: | ||
CI: true | ||
CI_PROVIDER: VSTS | ||
NPM_BIN_PATH: /usr/local/bin/npm | ||
npm_config_build_from_source: true | ||
condition: or(ne(variables['MainNodeModulesRestored'], 'true'), ne(variables['ScriptNodeModulesRestored'], 'true'), ne(variables['ApmNodeModulesRestored'], 'true')) | ||
|
||
- task: DownloadBuildArtifacts@0 | ||
displayName: Download atom-mac.zip | ||
inputs: | ||
artifactName: 'atom-mac.zip' | ||
downloadPath: $(Build.SourcesDirectory) | ||
|
||
- script: unzip atom-mac.zip/atom-mac.zip -d out | ||
displayName: Unzip atom-mac.zip | ||
- template: templates/bootstrap.yml | ||
|
||
- task: DownloadBuildArtifacts@0 | ||
displayName: Download atom-mac-symbols.zip | ||
inputs: | ||
artifactName: 'atom-mac-symbols.zip' | ||
downloadPath: $(Build.SourcesDirectory) | ||
|
||
- script: unzip atom-mac-symbols.zip/atom-mac-symbols.zip -d out | ||
displayName: Unzip atom-mac-symbols.zip | ||
|
||
- script: | | ||
osascript -e 'tell application "System Events" to keystroke "x"' # clear screen saver | ||
caffeinate -s script/test # Run with caffeinate to prevent screen saver | ||
env: | ||
CI: true | ||
CI_PROVIDER: VSTS | ||
ATOM_JASMINE_REPORTER: list | ||
TEST_JUNIT_XML_ROOT: $(Common.TestResultsDirectory)/junit | ||
ATOM_RUN_CORE_TESTS: $(RunCoreTests) | ||
ATOM_RUN_PACKAGE_TESTS: $(RunPackageTests) | ||
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: MacOS | ||
condition: ne(variables['Atom.SkipTests'], 'true') | ||
|
||
- script: | | ||
mkdir -p $(Build.ArtifactStagingDirectory)/crash-reports | ||
cp ${HOME}/Library/Logs/DiagnosticReports/*.crash $(Build.ArtifactStagingDirectory)/crash-reports | ||
displayName: Stage Crash Reports | ||
condition: failed() | ||
- template: templates/download-unzip.yml | ||
parameters: | ||
artifacts: | ||
- atom-mac.zip | ||
- atom-mac-symbols.zip | ||
|
||
- task: PublishBuildArtifacts@1 | ||
inputs: | ||
PathtoPublish: $(Build.ArtifactStagingDirectory)/crash-reports | ||
ArtifactName: crash-reports.zip | ||
displayName: Upload Crash Reports | ||
condition: failed() | ||
- template: templates/test.yml |
This file contains hidden or 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
steps: | ||
- pwsh: | | ||
# OS specific env variables | ||
if ($env:AGENT_OS -eq "Windows_NT") { | ||
$env:NPM_BIN_PATH="C:/hostedtoolcache/windows/node/12.13.1/x64/npm.cmd" | ||
$env:npm_config_build_from_source=true | ||
} | ||
if ($env:AGENT_OS -eq "Darwin") { | ||
$env:NPM_BIN_PATH="/usr/local/bin/npm" | ||
$env:npm_config_build_from_source=true | ||
} | ||
if ($env:AGENT_OS -eq "Linux") { | ||
$env:NPM_BIN_PATH="/usr/local/bin/npm" | ||
$env:CC=clang | ||
$env:CXX=clang++ | ||
$env:npm_config_clang=1 | ||
} | ||
|
||
# Bootstrap | ||
if (($env:AGENT_OS -eq "Windows_NT") -and ($env:BUILD_ARCH -eq "x86")) { | ||
node 'script\vsts\windows-run.js' 'script\bootstrap.cmd' | ||
} | ||
else { | ||
script/bootstrap | ||
} | ||
displayName: Bootstrap build environment | ||
env: | ||
GITHUB_TOKEN: $(GITHUB_TOKEN) | ||
CI: true | ||
CI_PROVIDER: VSTS | ||
condition: or(ne(variables['MainNodeModulesRestored'], 'true'), ne(variables['ScriptNodeModulesRestored'], 'true'), ne(variables['ApmNodeModulesRestored'], 'true')) | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This indentation makes
condition
and env variable. Bootstrapping always runs.We should indent it two spaces less, toward the left.
(We should change this on
master
now, I guess.)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for catching this. I will fix it!