-
Notifications
You must be signed in to change notification settings - Fork 30
84 lines (71 loc) · 2.49 KB
/
build-tests.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
name: Build Tests
on: [push, pull_request]
jobs:
build-test:
name: Build Test
runs-on: ubuntu-latest
strategy:
matrix:
os:
- 'fedora:latest'
- 'debian:testing'
- 'ubuntu:rolling'
# Disable CentOS due to missing dependencies
# - 'centos:7'
# - 'centos:8'
container: ${{ matrix.os }}
steps:
- name: Clone repository
uses: actions/checkout@v2
- name: Set up Java
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'adopt'
- name: Install Fedora/CentOS dependencies
if: ${{ startsWith(matrix.os, 'fedora:') || startsWith(matrix.os, 'centos:') }}
run: |
dnf install -y dnf-plugins-core rpm-build maven
dnf builddep -y --spec jss.spec
- name: Install Debian/Ubuntu dependencies
if: ${{ startsWith(matrix.os, 'debian:') || startsWith(matrix.os, 'ubuntu:') }}
run: |
apt-get update
apt-get install -y \
cmake zip unzip \
g++ libnss3-dev libnss3-tools \
openjdk-17-jdk libcommons-lang3-java libslf4j-java junit4 \
maven
- name: Build JSS with CMake
run: ./build.sh --with-tests
- name: Build JSS with Maven
run: mvn package
- name: Compare jss.jar
run: |
jar tvf ~/build/jss/jss.jar | awk '{print $8;}' | sort | tee cmake.out
jar tvf base/target/jss-5.3.0-SNAPSHOT.jar | awk '{print $8;}' | grep -v '^META-INF/maven/' | sort > maven.out
diff cmake.out maven.out
# TODO: Run examples
# Compare JNI symbols in the code and in the version script.
# If there are JNI symbols in the code but not in the version script -> fail.
symbol-test:
name: Symbol Test
runs-on: ubuntu-latest
env:
JAVA_HOME: /usr/lib/jvm/java-17-openjdk-amd64
steps:
- name: Clone repository
uses: actions/checkout@v2
- name: Get JNI symbols in the code
run: |
grep -iroh '^Java_org_mozilla[^(;]*' native/src/main/native/ | sort -u > /tmp/functions.txt
cat /tmp/functions.txt
- name: Get JNI symbols in the version script
run: |
grep -iroh '^Java_org_mozilla[^(;]*' lib/ | sort -u > /tmp/version.txt
cat /tmp/version.txt
- name: Compare JNI symbols
run: |
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