forked from ybroeker/wildfly-camunda-feature-pack
-
Notifications
You must be signed in to change notification settings - Fork 0
152 lines (125 loc) · 5.26 KB
/
ci.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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
name: Galleon Pack Template Java CI
on: [push, pull_request]
jobs:
# This just runs mvn install like a user would on cloning the repository
raw:
name: Normal checkout
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v1
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '11'
- name: Build and Test
run: |
mvn --version
mvn -B install
- name: Zip Artifacts
run: zip -R artifacts.zip 'server.log' 'surefire-reports/*.txt' 'surefire-reports/*.xml'
- uses: actions/upload-artifact@v1
with:
# Expressions in the name don't seem to get resolved
#name: ci-artifacts-galleon-template-raw-{{job.container.id}}
name: ci-artifacts-galleon-template-raw
path: artifacts.zip
wildfly-master:
# This adjusts the build to use the versions from wildfly master
name: Against WildFly master
runs-on: ubuntu-latest
steps:
- name: Checkout feature pack
uses: actions/checkout@v2
with:
path: main
- name: Checkout wildfly master
uses: actions/checkout@v2
with:
repository: wildfly/wildfly
path: wildfly-master
- uses: actions/cache@v1
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '11'
- name: Initialise Feature Pack version
# Needed to download everything from Maven to not pollute the output in the next steps
run:
mvn help:evaluate -Dexpression=project.version -pl .
working-directory: main
- name: Set FEATURE_PACK_VERSION
run: |
TMP="$(mvn help:evaluate -Dexpression=project.version -pl . | grep -v '^\[')"
echo "FEATURE_PACK_VERSION=${TMP}" >> $GITHUB_ENV
echo "TMP ${TMP}"
working-directory: main
- name: Initialise WildFly versions
# Needed to download everything from Maven to not pollute the output in the next steps
run: |
mvn -B help:evaluate -Dexpression=project.version -pl .
mvn -B help:evaluate -Dexpression=version.org.wildfly.core -pl .
working-directory: wildfly-master
- name: Set WILDFLY_VERSION
run: |
TMP="$(mvn help:evaluate -Dexpression=project.version -pl . | grep -v '^\[')"
echo "WILDFLY_VERSION=${TMP}" >> $GITHUB_ENV
working-directory: wildfly-master
- name: Set WILDFLY_CORE_VERSION
run: |
TMP="$(mvn help:evaluate -Dexpression=version.org.wildfly.core -pl . | grep -v '^\[')"
echo "WILDFLY_CORE_VERSION=${TMP}" >> $GITHUB_ENV
working-directory: wildfly-master
- name: Show read versions
run: |
echo "Feature pack version ${FEATURE_PACK_VERSION}"
echo "WildFly version ${WILDFLY_VERSION}"
echo "WildFly Core version ${WILDFLY_CORE_VERSION}"
- name: Build WildFly master
run: mvn -B install -DskipTests
working-directory: wildfly-master
- name: Build and Test
run: |
mvn --version
mvn -B install -Dversion.org.wildfly=${WILDFLY_VERSION} -Dversion.org.wildfly.core=${WILDFLY_CORE_VERSION}
working-directory: main
- name: Calculate directories to check
run: |
SRV_DIR="build/target/wildfly-${WILDFLY_VERSION}-template-${FEATURE_PACK_VERSION}"
echo "BUILD_SERVER_DIR=${SRV_DIR}" >> $GITHUB_ENV
MODULES_BASE="${SRV_DIR}/modules/system/layers/base"
echo "UNDERTOW_MODULE_XML=${MODULES_BASE}/org/wildfly/extension/undertow/main/module.xml" >> $GITHUB_ENV
echo "CONTROLLER_MODULE_XML=${MODULES_BASE}/org/jboss/as/controller/main/module.xml" >> $GITHUB_ENV
- name: Check versions
run: |
if grep -q org.wildfly:wildfly-undertow:${WILDFLY_VERSION} "${UNDERTOW_MODULE_XML}" && grep -q org.wildfly.core:wildfly-controller:${WILDFLY_CORE_VERSION} "${CONTROLLER_MODULE_XML}"; then
echo "Versions in module.xml files as expected!"
else
echo "Versions in module.xml files not as expected!"
"Expected WildFly version '${WILDFLY_VERSION}' and Core version '${WILDFLY_CORE_VERSION}'"
echo "Showing contents of ${UNDERTOW_MODULE_XML} and ${CONTROLLER_MODULE_XML}"
echo "Exiting..."
exit 1
fi
working-directory: main
- name: Zip Artifacts
run: zip -R artifacts.zip 'server.log' 'surefire-reports/*.txt' 'surefire-reports/*.xml'
working-directory: main
- uses: actions/upload-artifact@v1
with:
# Expressions in the name don't seem to get resolved
#name: ci-artifacts-galleon-template-wf-master-{{job.container.id}}
name: ci-artifacts-galleon-template-wf-master
path: main/artifacts.zip