Update README #151
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] | |
env: | |
NAMESPACE: ${{ vars.REGISTRY_NAMESPACE || github.repository_owner }} | |
COPR_REPO: ${{ vars.COPR_REPO || '@pki/master' }} | |
jobs: | |
init: | |
name: Initialization | |
uses: ./.github/workflows/init.yml | |
secrets: inherit | |
build-test: | |
name: Build Test | |
needs: init | |
runs-on: ubuntu-latest | |
container: ${{ needs.init.outputs.base-image }} | |
steps: | |
- name: Clone repository | |
uses: actions/checkout@v3 | |
- name: Install dependencies | |
run: | | |
dnf install -y dnf-plugins-core moby-engine maven rpm-build | |
if [ -n "${{ env.COPR_REPO }}" ]; then dnf copr enable -y ${{ env.COPR_REPO }}; fi | |
dnf builddep -y --skip-unavailable --spec tomcatjss.spec | |
- name: Install JSS packages from jss-dist | |
run: | | |
docker pull quay.io/dogtagpki/jss-dist:latest | |
docker create --name=jss-dist quay.io/dogtagpki/jss-dist:latest | |
docker cp jss-dist:/root/RPMS /tmp/RPMS/ | |
docker rm -f jss-dist | |
dnf localinstall -y /tmp/RPMS/* | |
- name: Build with Ant | |
run: | | |
# Ant build needs the full Tomcat package | |
dnf install -y tomcat | |
./build.sh | |
- name: Install JSS into local Maven repo | |
run: | | |
# get JSS <major>.<minor>.<update> version | |
JSS_VERSION=$(rpm -q --qf "%{version}" dogtag-jss) | |
mvn install:install-file \ | |
-Dfile=/usr/lib/java/jss.jar \ | |
-DgroupId=org.dogtagpki.jss \ | |
-DartifactId=jss-base \ | |
-Dversion=$JSS_VERSION-SNAPSHOT \ | |
-Dpackaging=jar \ | |
-DgeneratePom=true | |
- name: Build with Maven | |
run: | | |
mvn package | |
- name: Compare tomcatjss.jar built by Ant vs. built by Maven | |
run: | | |
jar tvf ~/build/tomcatjss/jars/tomcatjss.jar | awk '{print $8;}' | sort | tee tomcatjss.ant | |
jar tvf main/target/tomcatjss.jar | awk '{print $8;}' | grep -v '^META-INF/maven/' | sort | tee tomcatjss.maven | |
diff tomcatjss.ant tomcatjss.maven | |
- name: Build Tomcat JSS RPMs | |
run: | | |
./build.sh --work-dir=build rpm | |
dnf install -y build/RPMS/*.rpm | |
- name: Compare tomcatjss.jar built by Maven vs. from RPM | |
run: | | |
jar tvf /usr/share/java/tomcatjss.jar | awk '{print $8;}' | grep -v '^META-INF/maven/' | sort | tee tomcatjss.rpm | |
diff tomcatjss.maven tomcatjss.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 |