From a8f5cb162447a565a317a6d4cbb04629d9500591 Mon Sep 17 00:00:00 2001 From: "Endi S. Dewata" Date: Fri, 1 Jul 2022 17:06:21 -0500 Subject: [PATCH] Update Maven build test The Maven build test in maven-tests.yml has been merged into build-tests.yml. It has also been updated to compare CMake build artifacts and Maven build artifacts. The comparison excludes META-INF/maven/ since that folder is only available in Maven build artifacts. --- .github/workflows/build-tests.yml | 30 +++++++++++++++++++++++++----- .github/workflows/maven-tests.yml | 29 ----------------------------- 2 files changed, 25 insertions(+), 34 deletions(-) delete mode 100644 .github/workflows/maven-tests.yml diff --git a/.github/workflows/build-tests.yml b/.github/workflows/build-tests.yml index 173f00f6a..23ad98cf7 100644 --- a/.github/workflows/build-tests.yml +++ b/.github/workflows/build-tests.yml @@ -6,8 +6,6 @@ jobs: build-test: name: Build Test runs-on: ubuntu-latest - env: - JAVA_HOME: /usr/lib/jvm/java-17-openjdk-amd64 strategy: matrix: os: @@ -22,10 +20,16 @@ jobs: - 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 + dnf install -y dnf-plugins-core rpm-build maven dnf builddep -y --spec jss.spec - name: Install Debian/Ubuntu dependencies @@ -35,11 +39,27 @@ jobs: apt-get install -y \ cmake zip unzip \ g++ libnss3-dev libnss3-tools \ - openjdk-17-jdk libcommons-lang3-java libslf4j-java junit4 + openjdk-17-jdk libcommons-lang3-java libslf4j-java junit4 \ + maven - - name: Build JSS binaries, Javadoc, and run tests + - name: Build JSS with CMake run: ./build.sh --with-tests + - name: Build JSS with Maven + run: mvn install + + - name: Compare jss.jar + run: | + jar tvf ~/build/jss/jss.jar | awk '{print $8;}' | sort | tee cmake.out + jar tvf target/jss-5.3.0-SNAPSHOT.jar | awk '{print $8;}' | grep -v '^META-INF/maven/' | sort > maven.out + diff cmake.out maven.out + + - name: Build examples + run: mvn compile + working-directory: examples + + # 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: diff --git a/.github/workflows/maven-tests.yml b/.github/workflows/maven-tests.yml deleted file mode 100644 index 97af9280b..000000000 --- a/.github/workflows/maven-tests.yml +++ /dev/null @@ -1,29 +0,0 @@ -name: Maven Tests - -on: [push, pull_request] - -jobs: - build: - name: Building JSS - runs-on: ubuntu-latest - env: - JAVA_HOME: /usr/lib/jvm/java-17-openjdk-amd64 - - steps: - - name: Clone repository - uses: actions/checkout@v2 - - - name: Set up Java - uses: actions/setup-java@v2 - with: - java-version: '17' - distribution: 'adopt' - - - name: Build JSS - run: mvn install - - - name: Build examples - run: mvn compile - working-directory: examples - - # TODO: Run examples