|
1 |
| -steps: |
2 |
| - - bash: | |
3 |
| - set -e pipefail |
4 |
| -
|
5 |
| - # Install htslib dependencies |
6 |
| - if [[ "$AGENT_OS" == "Linux" ]]; then |
7 |
| - sudo apt-get update && sudo apt-get install -y automake autoconf libbz2-dev liblzma-dev |
8 |
| - fi |
9 |
| -
|
10 |
| - # Install bcftools (only required for running the CLI tests) |
11 |
| - version=1.16 |
12 |
| - if [[ "$AGENT_OS" == "Linux" ]]; then |
13 |
| - pushd /tmp |
14 |
| - wget https://github.com/samtools/bcftools/releases/download/${version}/bcftools-${version}.tar.bz2 |
15 |
| - tar xfj bcftools-${version}.tar.bz2 |
16 |
| - cd bcftools-${version} |
17 |
| - ./configure --prefix=/usr |
18 |
| - make -j2 |
19 |
| - sudo make install |
20 |
| - popd |
21 |
| - else |
22 |
| - brew install bcftools automake |
23 |
| - fi |
24 |
| -
|
25 |
| - # Install some extra dependencies to speed up the core TileDB build |
26 |
| - if [[ "$AGENT_OS" == "Linux" ]]; then |
27 |
| - sudo apt-get install -y libssl-dev libbz2-dev liblz4-dev libtbb-dev libcurl4-openssl-dev zlib1g-dev |
28 |
| - fi |
29 |
| - displayName: 'Install dependencies' |
30 |
| -
|
31 |
| - - bash: | |
32 |
| - # azure bash does not treat intermediate failure as error |
33 |
| - # https://github.com/Microsoft/azure-pipelines-yaml/issues/135 |
34 |
| - set -e pipefail |
35 |
| -
|
36 |
| - # Azure sets "SYSTEM=build" for unknown reasons, which breaks the OpenSSL configure script (in TileDB itself) |
37 |
| - # - openssl configure uses ENV{SYSTEM} if available: |
38 |
| - # https://github.com/openssl/openssl/blob/6d745d740d37d680ff696486218b650512bbbbc6/config#L56 |
39 |
| - # - error description: |
40 |
| - # https://developercommunity.visualstudio.com/content/problem/602584/openssl-build-error-when-using-pipelines.htm |
41 |
| - unset SYSTEM |
42 |
| -
|
43 |
| - # Configure and build TileDB-VCF |
44 |
| - mkdir -p $BUILD_REPOSITORY_LOCALPATH/libtiledbvcf/build |
45 |
| - cd $BUILD_REPOSITORY_LOCALPATH/libtiledbvcf/build |
46 |
| - cmake -DCMAKE_INSTALL_PREFIX=$BUILD_REPOSITORY_LOCALPATH/dist .. |
47 |
| -
|
48 |
| - make -j4 all tiledb_vcf_unit |
49 |
| -
|
50 |
| - make install |
51 |
| -
|
52 |
| - displayName: 'Build and test TileDB-VCF' |
53 |
| -
|
54 |
| - - bash: | |
55 |
| - set -e pipefail |
56 |
| - pushd $BUILD_REPOSITORY_LOCALPATH/apis/java |
57 |
| -
|
58 |
| - ./gradlew assemble |
59 |
| -
|
60 |
| - export LD_LIBRARY_PATH=$BUILD_REPOSITORY_LOCALPATH/apis/java/build/resources/main/lib:$LD_LIBRARY_PATH |
61 |
| -
|
62 |
| - displayName: 'Build and test TileDB-VCF Java API' |
63 |
| -
|
64 |
| - - bash: | |
65 |
| - echo "Testing" |
66 |
| - ls |
67 |
| - echo "listing JNI" |
68 |
| - ls $BUILD_REPOSITORY_LOCALPATH/dist/lib |
69 |
| -
|
70 |
| - echo "listing 2" |
71 |
| - ls $BUILD_REPOSITORY_LOCALPATH/apis/java/build/install/lib |
72 |
| -
|
73 |
| -
|
74 |
| - if [[ ( "$AGENT_OS" == "Linux" ) ]]; then |
75 |
| - cp $BUILD_REPOSITORY_LOCALPATH/libtiledbvcf/build/externals/install/lib/*.so* $BUILD_BINARIESDIRECTORY |
76 |
| - cp $BUILD_REPOSITORY_LOCALPATH/dist/lib/*.so* $BUILD_BINARIESDIRECTORY |
77 |
| - cp $BUILD_REPOSITORY_LOCALPATH/apis/java/build/install/lib/*.so* $BUILD_BINARIESDIRECTORY |
78 |
| - fi |
79 |
| -
|
80 |
| - if [[ ( "$AGENT_OS" == "Darwin" ) ]]; then |
81 |
| - cp $BUILD_REPOSITORY_LOCALPATH/dist/lib/*.dylib $BUILD_BINARIESDIRECTORY |
82 |
| - cp $BUILD_REPOSITORY_LOCALPATH/apis/java/build/install/lib/*.dylib $BUILD_BINARIESDIRECTORY |
83 |
| - fi |
84 |
| -
|
85 |
| - displayName: 'Test' |
86 |
| -
|
87 |
| - - script: | |
88 |
| - echo $sourceVersion |
89 |
| - commitHash=${sourceVersion:0:7} |
90 |
| - echo $commitHash |
91 |
| - echo "##vso[task.setvariable variable=commitHash]$commitHash" ## Set variable for using in other tasks. |
92 |
| - env: { sourceVersion: $(Build.SourceVersion) } |
93 |
| - displayName: Git Hash 7-digit |
94 |
| -
|
95 |
| - - bash: | |
96 |
| - git describe --tags > $BUILD_REPOSITORY_LOCALPATH/version.txt |
97 |
| - displayName: 'Capture version' |
98 |
| -
|
99 |
| - - task: ArchiveFiles@2 |
100 |
| - inputs: |
101 |
| - rootFolderOrFile: '$(Build.BinariesDirectory)' |
102 |
| - includeRootFolder: false |
103 |
| - archiveType: 'tar' # Options: zip, 7z, tar, wim |
104 |
| - tarCompression: 'gz' # Optional. Options: gz, bz2, xz, none |
105 |
| - archiveFile: $(Build.ArtifactStagingDirectory)/tiledb-vcf-$(Agent.OS)-$(Build.SourceBranchName)-$(commitHash).tar.gz |
106 |
| - replaceExistingArchive: true |
107 |
| - verbose: true # Optional |
108 |
| - condition: succeeded() |
109 |
| - |
110 |
| - - task: PublishBuildArtifacts@1 |
111 |
| - inputs: |
112 |
| - pathtoPublish: $(Build.ArtifactStagingDirectory)/tiledb-vcf-$(Agent.OS)-$(Build.SourceBranchName)-$(commitHash).tar.gz |
113 |
| - artifactName: libraries |
114 |
| - condition: succeeded() |
115 |
| - |
116 |
| - - bash: | |
117 |
| - set -e pipefail |
118 |
| - # Display log files if the build failed |
119 |
| - echo "Dumping log files for failed build" |
120 |
| - echo "----------------------------------" |
121 |
| - for f in $(find $BUILD_REPOSITORY_LOCALPATH/libtiledbvcf/build -name *.log); |
122 |
| - do echo "------" |
123 |
| - echo $f |
124 |
| - echo "======" |
125 |
| - cat $f |
126 |
| - done; |
127 |
| - condition: failed() # only run this job if the build step failed |
128 |
| - displayName: "Print log files (failed build only)" |
0 commit comments