aboutsummaryrefslogtreecommitdiffstats
path: root/.ci/templates/job-gnuradio-grettus-build-src.yml
blob: 90521f80745c068d6af32b6ae50370195c230c71 (plain)
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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
parameters:
- name: 'toolset'
  type: string
  values:
  - make

jobs:
- job: build_and_upload_gnuradio_grettus_${{ parameters.toolset }}
  displayName: ${{ parameters.toolset }}, ctest, and upload gnuradio and grettus
  dependsOn: get_latest_uhd_docker
  variables:
    # Docker vars from job-get-latest-uhd-docker.yml
    dockerBuildNumber: $[ dependencies.get_latest_uhd_docker.outputs['setDockerVar.dockerBuildNumber'] ]
    dockerImagePrefix: $[ dependencies.get_latest_uhd_docker.outputs['setDockerVar.dockerImagePrefix'] ]
    dockerImageMatrixLin: $[ dependencies.get_latest_uhd_docker.outputs['setDockerVar.dockerImageMatrixLin'] ]
    dockerImageMatrixWin: $[ dependencies.get_latest_uhd_docker.outputs['setDockerVar.dockerImageMatrixWin'] ]
    dockerImageMatrixUbuntuDeb: $[ dependencies.get_latest_uhd_docker.outputs['setDockerVar.dockerImageMatrixUbuntuDeb'] ]
    macOSBuilders: $[ dependencies.get_latest_uhd_docker.outputs['setDockerVar.macOSBuilders'] ]
  pool:
    ${{ if eq(parameters.toolset, 'msbuild') }}:
      name: de-dre-lab
    ${{ if ne(parameters.toolset, 'msbuild') }}:
      name: Drivers-NIBuildFarm-RFMIBUILD
    demands:
      - ${{ if eq(parameters.toolset, 'msbuild') }}:
        - docker
        - Agent.OS -equals Windows_NT
      - ${{ if or(eq(parameters.toolset, 'make'), eq(parameters.toolset, 'make_trace'), eq(parameters.toolset, 'ninja'), eq(parameters.toolset, 'make_custom_boost_version')) }}:
        - docker
        - Agent.OS -equals Linux
      - ${{ if eq(parameters.toolset, 'make_homebrew_macos') }}:
        - Agent.OS -equals Darwin
        - Agent.OSVersion -equals $(macOSVersionDemand)
        - Agent.OSArchitecture -equals $(macOSArchDemand)
  workspace:
    clean: outputs
  strategy:
    ${{ if eq(parameters.toolset, 'msbuild') }}:
      matrix: $[ variables.dockerImageMatrixWin ]
    ${{ if or(eq(parameters.toolset, 'make'), eq(parameters.toolset, 'make_trace'), eq(parameters.toolset, 'ninja'), eq(parameters.toolset, 'make_custom_boost_version')) }}:
      matrix: $[ variables.dockerImageMatrixLin ]
    ${{ if eq(parameters.toolset, 'make_homebrew_macos') }}:
      matrix: $[ variables.macOSBuilders ]
  ${{ if ne(parameters.toolset, 'make_homebrew_macos') }}:
    container:
      image: '$(dockerImagePrefix)$(DockerImageName):$(dockerBuildNumber)'
      endpoint: 'Docker / Artifactory - rnd-builds-local'
  steps:
  - checkout: self
    clean: true
  - checkout: gnuradio
    clean: true
    submodules: recursive
  - checkout: gr-ettus
    clean: true

  - task: DeleteFiles@1
    inputs:
      SourceFolder: $(Agent.BuildDirectory)
      Contents: |
        uhddev-$(buildOSName)-${{ parameters.toolset }}
    displayName: Delete uhddev artifacts folder

  - download: uhd_build_docker_container

  - download: current
    artifact: uhddev-$(buildOSName)-${{ parameters.toolset }}
    displayName: Download pipeline artifact uhddev-$(buildOSName)-${{ parameters.toolset }}

  - task: ExtractFiles@1
    inputs:
      archiveFilePatterns: $(Pipeline.Workspace)/uhddev-$(buildOSName)-${{ parameters.toolset }}/uhddev-$(buildOSName)-${{ parameters.toolset }}.tar.gz
      destinationFolder: $(Agent.BuildDirectory)/uhddev-$(buildOSName)-${{ parameters.toolset }}
      cleanDestinationFolder: false
    displayName: Extract uhddev-$(buildOSName)-${{ parameters.toolset }} artifacts

  - ${{ if eq(parameters.toolset, 'make') }}:
    - template: steps-build-gnuradio-make.yml
      parameters:
        gnuradioSrcDir: $(Build.SourcesDirectory)/gnuradio
        gnuradioBuildDir: $(Build.BinariesDirectory)/gnuradio/build
        gnuradioInstallPath: $(Build.BinariesDirectory)/gnuradio/build-installed
        uhdInstalledArtifactPath: $(Agent.BuildDirectory)/uhddev-$(buildOSName)-${{ parameters.toolset }}/uhddev/build-installed

  - ${{ if eq(parameters.toolset, 'make') }}:
    - template: steps-build-gr-ettus-make.yml
      parameters:
        grettusSrcDir: $(Build.SourcesDirectory)/gr-ettusdev
        grettusBuildDir: $(Build.BinariesDirectory)/gr-ettusdev/build
        grettusInstallPath: $(Build.BinariesDirectory)/gnuradio/build-installed
        uhdInstalledArtifactPath: $(Agent.BuildDirectory)/uhddev-$(buildOSName)-${{ parameters.toolset }}/uhddev/build-installed
        gnuradioInstalledArtifactPath: $(Build.BinariesDirectory)/gnuradio/build-installed

  - task: ArchiveFiles@2
    inputs:
      rootFolderOrFile: $(Build.BinariesDirectory)
      includeRootFolder: false
      archiveType: tar
      tarCompression: gz
      archiveFile: $(Build.ArtifactStagingDirectory)/gnuradio-grettus-$(buildOSName)-${{ parameters.toolset }}.tar.gz
      replaceExistingArchive: true
    displayName: Compress build files

  - task: CopyFiles@2
    inputs:
      sourceFolder: $(Pipeline.Workspace)/uhd_build_docker_container/$(UHDPipelineDockerImageArtifactName)
      targetFolder: $(Build.ArtifactStagingDirectory)
    displayName:  Copy builder container version to artifact folder

  - task: PublishPipelineArtifact@1
    inputs:
      targetPath: '$(Build.ArtifactStagingDirectory)'
      artifactName: 'gnuradio-grettus-$(buildOSName)-${{ parameters.toolset }}'
    displayName: Upload gnuradio and gr-ettus build artifacts