Update build test to reuse builder image #54
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: | |
wait-for-build: | |
name: Waiting for build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Wait for build | |
uses: lewagon/[email protected] | |
with: | |
ref: ${{ github.ref }} | |
check-name: 'Building IDM Console Framework' | |
repo-token: ${{ secrets.GITHUB_TOKEN }} | |
wait-interval: 30 | |
if: github.event_name == 'push' | |
- name: Wait for build | |
uses: lewagon/[email protected] | |
with: | |
ref: ${{ github.event.pull_request.head.sha }} | |
check-name: 'Building IDM Console Framework' | |
repo-token: ${{ secrets.GITHUB_TOKEN }} | |
wait-interval: 30 | |
if: github.event_name == 'pull_request' | |
build-test: | |
name: Build Test | |
needs: wait-for-build | |
runs-on: ubuntu-latest | |
env: | |
SHARED: /tmp/workdir/idm-console-framework | |
steps: | |
- name: Clone repository | |
uses: actions/checkout@v3 | |
- name: Retrieve IDM Console Framework images | |
uses: actions/cache@v3 | |
with: | |
key: idm-console-framework-images-${{ github.sha }} | |
path: idm-console-framework-images.tar | |
- name: Load IDM Console Framework images | |
run: docker load --input idm-console-framework-images.tar | |
- name: Set up IDM Console Framework container | |
run: | | |
tests/bin/runner-init.sh idm-console-framework | |
env: | |
IMAGE: idm-console-framework-builder | |
HOSTNAME: idm-console-framework.example.com | |
- name: Build with Ant | |
run: | | |
docker exec idm-console-framework ./build.sh | |
- name: Install JSS into local Maven repo | |
run: | | |
# get JSS <major>.<minor>.<update> version | |
JSS_VERSION=$(docker exec idm-console-framework rpm -q --qf "%{version}" dogtag-jss) | |
# if built by COPR, jss-base.jar will be installed in /usr/lib/java, | |
# otherwise it will be in /usr/share/java. | |
JSS_BASE_JAR=$(docker exec idm-console-framework find /usr/lib/java /usr/share/java -name jss-base.jar) | |
docker exec idm-console-framework mvn install:install-file \ | |
-Dfile=$JSS_BASE_JAR \ | |
-DgroupId=org.dogtagpki.jss \ | |
-DartifactId=jss-base \ | |
-Dversion=$JSS_VERSION-SNAPSHOT \ | |
-Dpackaging=jar \ | |
-DgeneratePom=true | |
- name: Install LDAP JDK into local Maven repo | |
run: | | |
# get LDAP JDK <major>.<minor>.<update> version | |
LDAPJDK_VERSION=$(docker exec idm-console-framework rpm -q --qf "%{version}" dogtag-ldapjdk) | |
docker exec idm-console-framework mvn install:install-file \ | |
-Dfile=/usr/share/java/ldapjdk.jar \ | |
-DgroupId=org.dogtagpki.ldap-sdk \ | |
-DartifactId=ldapjdk \ | |
-Dversion=$LDAPJDK_VERSION-SNAPSHOT \ | |
-Dpackaging=jar \ | |
-DgeneratePom=true | |
- name: Build with Maven | |
run: | | |
docker exec idm-console-framework mvn package | |
- name: Compare idm-console-framework.jar | |
run: | | |
docker exec idm-console-framework \ | |
jar tvf /root/build/idm-console-framework/release/jars/idm-console-framework.jar \ | |
| awk '{print $8;}' \ | |
| grep -v '/$' \ | |
| sort \ | |
| tee idm-console-framework.ant | |
docker exec idm-console-framework \ | |
jar tvf target/idm-console-framework.jar \ | |
| awk '{print $8;}' \ | |
| grep -v -E '^META-INF/maven/|/$' \ | |
| sort \ | |
| tee idm-console-framework.maven | |
diff idm-console-framework.ant idm-console-framework.maven |