Update test for Tomcat connector with NSS database #660
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build Tests | |
on: [push, pull_request] | |
jobs: | |
build-test: | |
name: Build Test | |
runs-on: ubuntu-latest | |
continue-on-error: true | |
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@v3 | |
- 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 \ | |
junit5 libopentest4j-java 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 \ | |
| grep -v '/$' \ | |
| tee cmake.out | |
jar tvf base/target/jss.jar | awk '{print $8;}' | sort \ | |
| grep -v '/$' \ | |
| grep -v '^META-INF/maven/' \ | |
| tee 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@v3 | |
- 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 | |
rpminspect: | |
name: RPMInspect | |
runs-on: ubuntu-latest | |
container: 'fedora:latest' | |
steps: | |
- name: Clone repository | |
uses: actions/checkout@v3 | |
- name: Set up Java | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '17' | |
distribution: 'adopt' | |
- name: Install Fedora dependencies | |
run: | | |
dnf install -y dnf-plugins-core rpm-build maven | |
dnf builddep -y --spec jss.spec | |
- name: Build JSS RPMs with CMake | |
run: ./build.sh --work-dir=build rpm | |
- name: Install RPMInspect | |
run: | | |
dnf install -y dnf-plugins-core | |
dnf copr enable -y copr.fedorainfracloud.org/dcantrell/rpminspect | |
dnf install -y rpminspect rpminspect-data-fedora | |
- name: Run RPMInspect on SRPM and RPMs | |
run: ./tests/bin/rpminspect.sh | |
sandbox-test: | |
name: Sandbox Test | |
runs-on: ubuntu-latest | |
container: fedora:rawhide | |
steps: | |
- name: Clone repository | |
uses: actions/checkout@v3 | |
- name: Install build dependencies | |
run: | | |
dnf install -y dnf-plugins-core | |
dnf builddep -y nspr nss jss | |
dnf builddep -y jss.spec | |
dnf install -y mercurial \ | |
python-unversioned-command \ | |
gyp \ | |
ninja-build | |
- name: Build NSPR and NSS | |
run: | | |
cd .. | |
hg clone https://hg.mozilla.org/projects/nspr | |
hg clone https://hg.mozilla.org/projects/nss | |
cd nss | |
./build.sh --enable-fips --enable-libpkix | |
- name: Build JSS | |
run: | | |
cd build | |
cmake -DCMAKE_BUILD_TYPE=Debug .. | |
make all | |
env: | |
SANDBOX: 1 | |
CFLAGS: -Wall -Wextra -Werror -Og -ggdb | |
- name: Run JSS tests | |
run: | | |
cd build | |
ctest --output-on-failure |