From 0ab2780c421f5b18549d9f215108e587e6fcbee6 Mon Sep 17 00:00:00 2001 From: Jarret Shook Date: Wed, 5 Dec 2018 14:00:32 -0800 Subject: [PATCH] Change from phases to jobs (#21384) * Initial change to use jobs/jobs.yml * Fix If syntax * Hopefully fix more syntax * Change from jobs to job * change from queue to pool * change scope of container name * Change build to sync and init tools inside build.sh * Add workspace --- eng/build-job.yml | 26 ++++-------------------- eng/xplat-job.yml | 61 +++++++++++++++++++++++++++++++++++++------------------ 2 files changed, 45 insertions(+), 42 deletions(-) diff --git a/eng/build-job.yml b/eng/build-job.yml index e44df9c..3a5425f 100644 --- a/eng/build-job.yml +++ b/eng/build-job.yml @@ -35,37 +35,19 @@ jobs: - script: eng\common\init-tools-native.cmd -InstallDirectory $(Build.SourcesDirectory)\native-tools -Force displayName: Install native dependencies - # Run init-tools (pre-arcade dependency bootstrapping) - # TODO: replace this with an arcade equivalent - - ${{ if ne(parameters.osGroup, 'Windows_NT') }}: - - script: ./init-tools.sh - displayName: Init tools - - ${{ if eq(parameters.osGroup, 'Windows_NT') }}: - - script: .\init-tools.cmd - displayName: Init tools - - # Sync - - ${{ if ne(parameters.osGroup, 'Windows_NT') }}: - - script: ./Tools/dotnetcli/dotnet msbuild build.proj /p:RestoreDuringBuild=true /t:Sync - displayName: Sync - - ${{ if eq(parameters.osGroup, 'Windows_NT') }}: - - script: .\Tools\dotnetcli\dotnet.exe msbuild build.proj /p:RestoreDuringBuild=true /t:Sync - displayName: Sync - - # Build - ${{ if and(and(ne(parameters.archType, 'arm'), ne(parameters.archType, 'arm64')), ne(parameters.osGroup, 'Windows_NT')) }}: - - script: ./build.sh $(buildConfig) $(archType) -skipnuget -skiprestore + - script: ./build.sh $(buildConfig) $(archType) -skiptests displayName: Build product - ${{ if and(ne(parameters.osGroup, 'Windows_NT'), eq(parameters.archType, 'arm')) }}: - - script: ROOTFS_DIR=$(rootfsDir) CAC_ROOTFS_DIR=$(cacRootfsDir) ./build.sh $(buildConfig) $(archType) -cross -skipnuget -skiprestore + - script: ROOTFS_DIR=$(rootfsDir) CAC_ROOTFS_DIR=$(cacRootfsDir) ./build.sh $(buildConfig) $(archType) -cross -skiptests displayName: Build product - ${{ if and(ne(parameters.osGroup, 'Windows_NT'), eq(parameters.archType, 'arm64')) }}: - - script: ROOTFS_DIR=$(rootfsDir) ./build.sh $(buildConfig) $(archType) -cross -skipnuget -skiprestore + - script: ROOTFS_DIR=$(rootfsDir) ./build.sh $(buildConfig) $(archType) -cross -skiptests displayName: Build product - ${{ if eq(parameters.osGroup, 'Windows_NT') }}: # TODO: IBCOptimize? EnforcePGO? pass an OfficialBuildId? SignType? file logging parameters? - - script: set __TestIntermediateDir=int&&build.cmd $(buildConfig) $(archType) -skiptests -skipbuildpackages -skiprestore + - script: set __TestIntermediateDir=int&&build.cmd $(buildConfig) $(archType) -skiptests displayName: Build product diff --git a/eng/xplat-job.yml b/eng/xplat-job.yml index 9677da4..9c92ea4 100644 --- a/eng/xplat-job.yml +++ b/eng/xplat-job.yml @@ -11,7 +11,7 @@ parameters: variables: {} ## any extra variables to add to the defaults defined below jobs: -- template: /eng/common/templates/phases/base.yml +- template: /eng/common/templates/job/job.yml parameters: name: ${{ parameters.name }} @@ -21,7 +21,7 @@ jobs: dependsOn: ${{ parameters.dependsOn }} - queue: + pool: ${{ if and(eq(parameters.osGroup, 'Linux'), eq(variables['System.TeamProject'], 'public')) }}: name: Hosted Ubuntu 1604 ${{ if and(eq(parameters.osGroup, 'Linux'), ne(variables['System.TeamProject'], 'public')) }}: @@ -36,8 +36,11 @@ jobs: name: dotnet-external-temp timeoutInMinutes: 240 - ${{ if ne(parameters.containerName, '') }}: - container: ${{ parameters.containerName }} + workspace: + clean: all + + ${{ if ne(parameters.containerName, '') }}: + container: ${{ parameters.containerName }} ${{ if eq(parameters.osGroup, 'Linux') }}: agentOs: Ubuntu @@ -47,24 +50,42 @@ jobs: agentOs: Windows_NT variables: - buildConfig: ${{ parameters.buildConfig }} - ${{ if eq(parameters.buildConfig, 'checked') }}: - buildConfigUpper: 'Checked' - ${{ if eq(parameters.buildConfig, 'debug') }}: - buildConfigUpper: 'Debug' - ${{ if eq(parameters.buildConfig, 'release') }}: - buildConfigUpper: 'Release' - archType: ${{ parameters.archType }} - osGroup: ${{ parameters.osGroup }} - osGroupName: ${{ parameters.osGroupName }} + - name: buildConfig + value: ${{ parameters.buildConfig }} + + - ${{ if eq(parameters.buildConfig, 'checked') }}: + - name: buildConfigUpper + value: 'Checked' + + - ${{ if eq(parameters.buildConfig, 'debug') }}: + - name: buildConfigUpper + value: 'Debug' + + - ${{ if eq(parameters.buildConfig, 'release') }}: + - name: buildConfigUpper + value: 'Release' + + - name: archType + value: ${{ parameters.archType }} + + - name: osGroup + value: ${{ parameters.osGroup }} + + - name: osGroupName + value: ${{ parameters.osGroupName }} # Crossbuild specific variables. - ${{ if eq(parameters.archType, 'arm') }}: - rootfsDir: /crossrootfs/arm - cacRootfsDir: /crossrootfs/x86 - ${{ if eq(parameters.archType, 'arm64') }}: - rootfsDir: /crossrootfs/arm64 + - ${{ if eq(parameters.archType, 'arm') }}: + - name: rootfsDir + value: /crossrootfs/arm + + - name: cacRootfsDir + value: /crossrootfs/x86 + + - ${{ if eq(parameters.archType, 'arm64') }}: + - name: rootfsDir + value: /crossrootfs/arm64 - ${{insert}}: ${{ parameters.variables }} + - ${{insert}}: ${{ parameters.variables }} steps: ${{ parameters.steps }} -- 2.7.4