-
Notifications
You must be signed in to change notification settings - Fork 30
/
azure-pipelines.yml
117 lines (103 loc) · 3.4 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
# Provide docker in container for installing dependencies as root.
# https://github.com/Microsoft/azure-pipelines-agent/issues/2043#issuecomment-687983301
resources:
containers:
# This no longer works for Fedora
# - container: fedora_latest
# image: fedora:latest
# options: '--name runner -v /usr/bin/docker:/usr/bin/docker:ro'
- container: debian_testing
image: debian:testing
options: '--name runner -v /usr/bin/docker:/usr/bin/docker:ro'
- container: ubuntu_rolling
image: ubuntu:rolling
options: '--name runner -v /usr/bin/docker:/usr/bin/docker:ro'
jobs:
- job: BuildTest_dnf
pool:
vmImage: ubuntu-latest
steps:
- task: PythonScript@0
displayName: Set environment variables
inputs:
scriptSource: inline
script: |
import os
value = os.getenv('BASE_IMAGE', 'registry.fedoraproject.org/fedora:latest')
print('BASE_IMAGE: {value}'.format(value=value))
print('##vso[task.setvariable variable=BASE_IMAGE]{value}'.format(value=value))
- script: |
docker build \
--build-arg BASE_IMAGE=$BASE_IMAGE \
--target jss-base \
--tag jss-base:latest \
.
docker run \
--name runner \
--privileged \
--detach \
jss-base:latest
while :
do
docker exec runner echo "Runner is ready" && break
echo "Waiting for runner..."
sleep 1
[ $((++i)) -ge 10 ] && exit 1
done
displayName: Create runner container
- script: |
docker exec runner dnf install -y dnf-plugins-core rpm-build
if [ -n "$COPR_REPO" ]; then docker exec runner dnf copr enable -y $COPR_REPO; fi
docker cp . runner:/root/src
docker exec -w /root/src runner dnf builddep -y --spec jss.spec
displayName: Install build dependencies
- script: docker exec -w /root/src runner ./build.sh
displayName: Build JSS binaries, Javadoc, and run tests
- job: BuildTest_apt
pool:
vmImage: ubuntu-latest
strategy:
matrix:
debian_testing:
image: debian_testing
ubuntu_rolling:
image: ubuntu_rolling
container: $[variables['image']]
steps:
- script: |
docker exec -u 0 runner apt-get update
# https://salsa.debian.org/freeipa-team/jss/-/blob/master/debian/control
docker exec -u 0 runner apt-get install -y \
cmake \
g++ \
junit5 \
libcommons-lang3-java \
libnss3-dev \
libnss3-tools \
libopentest4j-java \
libslf4j-java \
openjdk-17-jdk \
unzip \
zip
displayName: Install build dependencies
- script: ./build.sh
displayName: Build JSS binaries, Javadoc, and run tests
env:
JAVA_HOME: /usr/lib/jvm/java-17-openjdk-amd64
- job: SymbolTest
pool:
vmImage: ubuntu-latest
steps:
- script: |
grep -iroh '^Java_org_mozilla[^(;]*' native/src/main/native/ | sort -u > /tmp/functions.txt
cat /tmp/functions.txt
displayName: Get JNI symbols in the code
- script: |
grep -iroh '^Java_org_mozilla[^(;]*' lib/ | sort -u > /tmp/version.txt
cat /tmp/version.txt
displayName: Get JNI symbols in the version script
- script: |
diff /tmp/functions.txt /tmp/version.txt || true
comm -23 --check-order /tmp/functions.txt /tmp/version.txt > /tmp/diff.txt
test ! -s /tmp/diff.txt
displayName: Compare JNI symbols