forked from dogtagpki/tomcatjss
-
Notifications
You must be signed in to change notification settings - Fork 0
84 lines (69 loc) · 2.64 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]
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