From f9c046401ab09476b1ab3b556d28947acdc9f366 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Mon, 4 May 2020 13:23:04 +0900 Subject: [PATCH] Use Azure Pipelines for building --- .appveyor.yml | 41 --------------------------- .gitmodules | 2 +- .travis.yml | 55 ------------------------------------ azure-pipelines-template.yml | 45 +++++++++++++++++++++++++++++ azure-pipelines.yml | 38 +++++++++++++++++++++++++ base | 2 +- scripts/test.js | 2 +- 7 files changed, 86 insertions(+), 99 deletions(-) delete mode 100644 .appveyor.yml delete mode 100644 .travis.yml create mode 100644 azure-pipelines-template.yml create mode 100644 azure-pipelines.yml diff --git a/.appveyor.yml b/.appveyor.yml deleted file mode 100644 index bab97e2..0000000 --- a/.appveyor.yml +++ /dev/null @@ -1,41 +0,0 @@ -version: "{build}" - -os: Visual Studio 2017 - -init: - - git config --global core.autocrlf input - -platform: x64 -environment: - matrix: - - TARGET_CPU: x64 - -install: - - ps: Install-Product node 8 - - cmd: SET PATH=C:\Program Files (x86)\MSBuild\14.0\bin\;%PATH% - - cmd: SET PATH=C:\python27;%PATH% - - cmd: node scripts/bootstrap.js --target-cpu=%TARGET_CPU% - - cmd: node scripts/build.js out/Release - - cmd: node scripts/create_dist.js - - cmd: node scripts/test.js - -artifacts: - - path: 'out\Release\*.zip' - -deploy: - - provider: GitHub - release: GN $(APPVEYOR_REPO_TAG_NAME) - tag: $(APPVEYOR_REPO_TAG_NAME) - description: '(placeholder)' - auth_token: - secure: A6p8IoStnodPh/lGnc41E+ACsYdyfOV3Z7K6H3w0Xz2SsLpL06AKb6PTNmMtWp1F - artifact: /.*\.zip/ - draft: true - force_update: true - prerelease: false - on: - appveyor_repo_tag: true - -# disable build and test pahses -build: off -test: off diff --git a/.gitmodules b/.gitmodules index 1bacec1..19eb8f8 100644 --- a/.gitmodules +++ b/.gitmodules @@ -15,7 +15,7 @@ url = https://chromium.googlesource.com/chromium/src/third_party/tcmalloc/chromium [submodule "base"] path = base - url = https://chromium.googlesource.com/chromium/src/base + url = https://github.com/yue/base [submodule "third_party/ced/src"] path = third_party/ced/src url = https://github.com/google/compact_enc_det.git diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 946a4f9..0000000 --- a/.travis.yml +++ /dev/null @@ -1,55 +0,0 @@ -git: - depth: 10 -notifications: - email: false - -language: node_js -node_js: - - "10" -os: - - osx - - linux -osx_image: xcode10.1 -dist: trusty -sudo: required - -addons: - apt: - sources: - - ubuntu-toolchain-r-test - - sourceline: 'ppa:webkit-team/ppa' - packages: - - gcc-5-multilib - - g++-5-multilib - - linux-libc-dev:i386 - -env: - - TARGET_CPU=x64 - -before_script: - - export GN_VERSION=$(git describe --always --tags) - - if [ "$TRAVIS_OS_NAME" == "linux" ]; then - sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-5 1000; - sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-5 1000; - fi - -script: - - node scripts/bootstrap.js --target-cpu=$TARGET_CPU - - node scripts/build.js out/Release - - node scripts/create_dist.js - - node scripts/test.js - -deploy: - provider: releases - api_key: - secure: Oy8eKtgN8TtE0ULgzGb5Z0+HwmrCwqptLiMOsuPg8Iw85FQJn9DjgvzbLWcLkS0PIaei914LNPpUvgYwQUOWqfMWsE+4vf9h3N6NKJVT/5LRCbEQBU2eYf90MmkbfY7VJECT11m1jyWSUAre3DawDfw1jiT7QIWkcRp334UG8Hw15FGOR9pbFgCJI5ziKwBsRDcQpDO1rkxHYNUXrEkdj3l6ycv/gCQwMfpPneRqrt/cx/EsmOy3Cfyg1vaWKzvLsnGAWzAy8UoXX629L/AuDBnewIXfOFBwwbslyJ/sc125K8lk1ltP+SBz4Ca+6NszJO2ADH/bbersXebEb4hkFyxNsHMMENb+2vIWiSxqkyFiS7UM15PHZ1xobqmT9xL079CRpyekYysryObL6QT0SlNCLlzTtmDkVC5i/TCsW6ilpoKYjZEV5OekPoJO/fP7D4QrIZjvKnYPPmsBsP86QV2H5/AMj2y7NmfLqCnh8k9QHCdcOQdnmxfIvMwt9+TEgAv++HFREk7xaCWJpsoYQaNGlTqim2ALyZYpEzyGeH98crSoUiSIAHWcByAbYgweQT3xOgR5a4WFjQSNTaAYZVa6MhmUh8O3Kj3PjYGrFtaNHcVSzCNIX6H2V9/sWv0hIQmglBHZ6Iwtf8OhBDZ4aloa836hEDR7vwpfU7s4914= - file_glob: true - file: out/Release/*.zip - skip_cleanup: true - overwrite: true - draft: true - tag_name: ${GN_VERSION} - name: GN ${GN_VERSION} - body: (placeholder) - on: - tags: true diff --git a/azure-pipelines-template.yml b/azure-pipelines-template.yml new file mode 100644 index 0000000..2ccfa3d --- /dev/null +++ b/azure-pipelines-template.yml @@ -0,0 +1,45 @@ +steps: +- task: NodeTool@0 + inputs: + versionSpec: 12.x + +- task: UsePythonVersion@0 + inputs: + versionSpec: '2.7' + architecture: 'x64' + +- bash: | + node scripts/bootstrap.js --target-cpu=$TARGET_CPU + node scripts/build.js out/Release + displayName: Build + +- script: node scripts/create_dist.js + displayName: Create distribution + +- script: node scripts/test.js + displayName: Run tests + +- bash: | + BRANCH=$(Build.SourceBranch) + TAG=${BRANCH:10} + echo "##vso[task.setvariable variable=Name;isOutput=true]$TAG" + displayName: Get Tag Name + name: Tag + condition: startsWith(variables['Build.SourceBranch'], 'refs/tags/') + +- task: GithubRelease@0 + displayName: Create GitHub Release + condition: startsWith(variables['Tag.Name'], 'v') + inputs: + gitHubConnection: GitHub Yue + repositoryName: yue/build-gn + action: Edit + tagSource: auto + tag: $(Tag.Name) + title: GN $(Tag.name) + releaseNotesSource: input + releaseNotes: (placeholder) + assets: 'out/Release/*.zip' + assetUploadMode: replace + isDraft: true + addChangelog: false diff --git a/azure-pipelines.yml b/azure-pipelines.yml new file mode 100644 index 0000000..7690826 --- /dev/null +++ b/azure-pipelines.yml @@ -0,0 +1,38 @@ +trigger: +- refs/heads/* +- refs/pull/*/merge +- refs/tags/* + +jobs: +- job: windows_build + displayName: 'Build for Windows' + pool: + vmImage: 'VS2017-Win2016' + strategy: + matrix: + x64: + TARGET_CPU: x64 + steps: + - template: azure-pipelines-template.yml + +- job: macos_build + displayName: 'Build for macOS' + pool: + vmImage: 'macOS-10.14' + strategy: + matrix: + x64: + TARGET_CPU: x64 + steps: + - template: azure-pipelines-template.yml + +- job: linux_build + displayName: 'Build for Linux' + pool: + vmImage: 'ubuntu-18.04' + strategy: + matrix: + x64: + TARGET_CPU: x64 + steps: + - template: azure-pipelines-template.yml diff --git a/base b/base index 352cd78..bc8eb82 160000 --- a/base +++ b/base @@ -1 +1 @@ -Subproject commit 352cd788c19ef4bbf40c213a6fe2e6cfed137dfc +Subproject commit bc8eb821f7b44f2b5f3dd08543ac28698c22aba0 diff --git a/scripts/test.js b/scripts/test.js index 2bbce1f..0a814b4 100755 --- a/scripts/test.js +++ b/scripts/test.js @@ -36,7 +36,7 @@ function runTests(error) { function runEachTest(project, projectPath) { console.log(`Generating ninja bulid for project "${project}"...`) - const outdir = path.join(tmppath, project, 'out') + const outdir = path.resolve('out', 'Test') const gn = path.join(tmppath, 'gn', 'gn') execSync(`${gn} gen ${outdir}`, {cwd: projectPath})