-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
155 lines (151 loc) · 5.87 KB
/
azure-pipelines.yml
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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
# Build wllczi for Windows-x86 and Windows-x64, then for Linux-x64,
# then use QEMU to run an ARM-32bit-build, then package everything into a paclet
trigger:
- master
jobs:
- job: Windowsx86
pool:
vmImage: 'windows-latest'
steps:
- task: DownloadSecureFile@1
inputs:
secureFile: 'C.zip'
- task: ExtractFiles@1
inputs:
archiveFilePatterns: '$(Agent.TempDirectory)\C.zip'
destinationFolder: 'mathematicaheaders'
cleanDestinationFolder: true
- task: CMake@1
inputs:
workingDirectory: $(Build.SourcesDirectory)/build
cmakeArgs: '.. -A Win32 -DCMAKE_BUILD_TYPE=Release -DWLLCZI_MATHEMATICAHEADERS=$(Build.SourcesDirectory)\mathematicaheaders\C -DWLLCZI_BUILD_UNITTESTS=ON'
- task: CmdLine@2
inputs:
script: 'cmake --build .\build --config Release'
- task: PublishPipelineArtifact@1
inputs:
targetPath: $(Build.SourcesDirectory)/build/wllczi/Release/wllczi.dll
artifactName: wllcziWinx86
- job: Windowsx64
pool:
vmImage: 'windows-latest'
steps:
- task: DownloadSecureFile@1
inputs:
secureFile: 'C.zip'
- task: ExtractFiles@1
inputs:
archiveFilePatterns: '$(Agent.TempDirectory)\C.zip'
destinationFolder: 'mathematicaheaders'
cleanDestinationFolder: true
- task: CMake@1
inputs:
cmakeArgs: '.. -A x64 -DCMAKE_BUILD_TYPE=Release -DWLLCZI_MATHEMATICAHEADERS=$(Build.SourcesDirectory)\mathematicaheaders\C -DWLLCZI_BUILD_UNITTESTS=ON'
- task: CmdLine@2
inputs:
script: 'cmake --build .\build --config Release'
- task: PublishPipelineArtifact@1
inputs:
targetPath: $(Build.SourcesDirectory)/build/wllczi/Release/wllczi.dll
artifactName: wllcziWinx64
- job: LinuxARM
timeoutInMinutes: 240
dependsOn:
- Windowsx86
- Windowsx64
pool:
vmImage: 'ubuntu-latest'
timeoutInMinutes: 240
steps:
- task: DownloadSecureFile@1
inputs:
secureFile: 'C.zip'
- task: DownloadSecureFile@1
inputs:
secureFile: 'zippw.txt'
- script: mkdir ~/artifacts;mkdir ~/artifacts/Winx86;mkdir ~/artifacts/Winx64;mkdir ~/artifacts/Linuxx64
displayName: 'Make folders where to put the Windows-binaries'
- task: DownloadPipelineArtifact@2
inputs:
artifact: wllcziWinx86
patterns: '**/*'
path: $(Agent.BuildDirectory)/artifacts/Winx86
- task: DownloadPipelineArtifact@2
inputs:
artifact: wllcziWinx64
patterns: '**/*'
path: $(Agent.BuildDirectory)/artifacts/Winx64
- task: ExtractFiles@1
inputs:
archiveFilePatterns: '$(Agent.TempDirectory)/C.zip'
destinationFolder: 'mathematicaheaders'
cleanDestinationFolder: true
- task: CMake@1
inputs:
cmakeArgs: '.. -DCMAKE_BUILD_TYPE=Release -DWLLCZI_MATHEMATICAHEADERS=$(Build.SourcesDirectory)\mathematicaheaders\C -DWLLCZI_BUILD_UNITTESTS=ON'
- script: |
cmake --build ./build --config Release
cp ./build/wllczi/libwllczi.so ~/artifacts/Linuxx64/
displayName: 'Build Linux-x64'
- task: PublishPipelineArtifact@1
inputs:
targetPath: $(Build.SourcesDirectory)/build/wllczi/libwllczi.so
artifactName: wllcziLinuxx64
- script: |
zippw=`cat $(Agent.TempDirectory)/zippw.txt`
cp $(Agent.BuildDirectory)/artifacts/Winx64/* ~/artifacts/Winx64
cp $(Agent.BuildDirectory)/artifacts/Winx86/* ~/artifacts/Winx86
sudo apt-get -qq update
sudo apt-get -qq install qemu-system-arm expect
qemu-system-arm --version
uname -a
lscpu
sudo modprobe nbd max_part=8 # enable NBD on the host
wget "https://onedrive.live.com/download?cid=A78BEB4649B27A1A&resid=A78BEB4649B27A1A%21551162&authkey=ADrKCXxToYnCyPU" -O raspiqemu.zip --no-verbose
unzip -P "$zippw" raspiqemu.zip
rm raspiqemu.zip
# we mount the image, and copy the Windows- and Linux-builds into the image
sudo qemu-nbd --connect=/dev/nbd0 raspiwllczibuildsystem/2020-02-13-raspbian-buster.qcow
sudo mkdir /mnt/raspi
sudo chmod 777 /mnt/raspi
sleep 1;sync
sudo mount /dev/nbd0p2 /mnt/raspi
sudo mkdir /mnt/raspi/home/pi/EXTDATA
sudo chmod 777 /mnt/raspi/home/pi/EXTDATA
sudo cp -r ~/artifacts /mnt/raspi/home/pi/EXTDATA
sudo umount /mnt/raspi/
sudo qemu-nbd --disconnect /dev/nbd0
cp CI/autorun.expect raspiwllczibuildsystem/autorun.expect
cp CI/run_raspi.sh raspiwllczibuildsystem/run_raspi.sh
chmod +x raspiwllczibuildsystem/autorun.expect
chmod +x raspiwllczibuildsystem/run_raspi.sh
mkdir paclet
cd paclet
# In order to get the resulting paclet back from the ARM-guest, we run a minimal web-server on the host,
# where the guest will put the result to. I tried to mount the image again, but for unknown reasons it did
# not work. Sure, there must be better ways, but this works nicely so far.
python3 ../CI/SimpleHTTPServerWithUpload.py &
cd ..
cd raspiwllczibuildsystem
sleep 1;sync
expect autorun.expect
echo "****************** QEMU FINISHED ******************"
sleep 1;sync;cd ..
kill %1 # stop the web-server
echo "ls -l paclet/";ls -l paclet/
countofiles=$(ls 2>/dev/null -Ubad1 -- paclet/*.paclet | wc -l) # check that we have more than one file
if [ $countofiles -eq 0 ]; then exit 1; fi # otherwise, end with error
echo ARM-build and paclet-generation succeeded
displayName: 'ARM-build & paclet generation'
- script: echo "##vso[task.setvariable variable=pacletname]`ls paclet/*.paclet`"
displayName: 'figure out name of paclet'
- task: PublishPipelineArtifact@1
inputs:
targetPath: '$(Build.SourcesDirectory)/$(pacletname)'
artifact: 'Paclet'
publishLocation: 'pipeline'
# - task: PublishBuildArtifacts@1
# inputs:
# PathtoPublish: '$(Build.SourcesDirectory)/$(pacletname)'
# ArtifactName: 'drop'
# publishLocation: 'Container'