-
Notifications
You must be signed in to change notification settings - Fork 271
101 lines (86 loc) · 5.54 KB
/
registry-rhbq-build.yaml
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
name: Registry RHBQ Build # job to build apicurio registry using Red Hat Build of Quarkus so the issues are detected earlier
on:
workflow_dispatch:
inputs:
branch:
description: 'Branch to checkout'
required: true
default: 'main'
maven-profiles:
description: 'Comma separated list of profiles to be activated'
required: true
default: 'prod,kafkasql,sql'
skip-tests:
description: 'Flag to run or skip tests'
required: true
default: 'false'
script-url:
description: 'Raw URL of the groovy manipulation script'
required: true
default: 'https://gist.githubusercontent.com/riprasad/a16a71a3062021739f025b763f95bab3/raw'
extra-params:
description: 'Extra Maven Build Parameters'
required: false
default: '-Dquarkus.package.type=legacy'
jobs:
build:
name: Build Project
runs-on: ubuntu-22.04
if: github.repository_owner == 'Apicurio'
steps:
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
- name: Workaround jackson-coreutils
run: |
# upstream issue: https://github.com/java-json-tools/jackson-coreutils/issues/59
rm -rf ~/.m2/repository/com/github/java-json-tools
mkdir -p /tmp/coreutils-workaround
( cd /tmp/coreutils-workaround && mvn dependency:get -DremoteRepositories=https://repo1.maven.org/maven2 -Dartifact=com.github.java-json-tools:jackson-coreutils:2.0 )
- name: Configure Red Hat Repository
run: |
pwd
mkdir -p /home/runner/.m2
chmod 755 /home/runner/.m2
echo "<settings><profiles><profile><id>public-repositories</id><repositories><repository><id>central</id><name>Maven Central</name><url>https://repo1.maven.org/maven2</url><releases><enabled>true</enabled></releases><snapshots><enabled>false</enabled></snapshots></repository></repositories><pluginRepositories><pluginRepository><id>central</id><name>Maven Central</name><url>https://repo1.maven.org/maven2</url><releases><enabled>true</enabled></releases><snapshots><enabled>false</enabled></snapshots></pluginRepository></pluginRepositories></profile><profile><id>redhat-repository</id><repositories><repository><id>redhat-repository</id><name>Red Hat repository</name><url>http://maven.repository.redhat.com/ga/</url><layout>default</layout><releases><enabled>true</enabled><updatePolicy>never</updatePolicy></releases><snapshots><enabled>false</enabled><updatePolicy>never</updatePolicy></snapshots></repository></repositories><pluginRepositories><pluginRepository><id>redhat-repository</id><name>Red Hat repository</name><url>http://maven.repository.redhat.com/ga/</url><layout>default</layout><releases><enabled>true</enabled><updatePolicy>never</updatePolicy></releases><snapshots><enabled>false</enabled><updatePolicy>never</updatePolicy></snapshots></pluginRepository></pluginRepositories></profile></profiles><activeProfiles><activeProfile>public-repositories</activeProfile><activeProfile>redhat-repository</activeProfile></activeProfiles></settings>" > /home/runner/.m2/settings.xml
- name: Apicurio Registry Checkout
run: |
mkdir registry
cd registry
git init
git remote add origin "https://github.com/Apicurio/apicurio-registry.git"
git fetch
git checkout ${{ github.event.inputs.branch }}
git branch --set-upstream-to=origin/${{ github.event.inputs.branch }}
git pull
- name: Download PME
run: mvn dependency:get -Dartifact=org.commonjava.maven.ext:pom-manipulation-cli:LATEST:jar -Ddest=/home/runner/.m2/pom-manipulation-cli.jar
- name: Run PME
run: cd registry && java -jar /home/runner/.m2/pom-manipulation-cli.jar -DgroovyScripts=${{ github.event.inputs.script-url }}
- name: Build Registry
run: pwd && cd registry && ./mvnw clean compile -P${{ github.event.inputs.maven-profiles }} -DskipTests=${{ github.event.inputs.skip-tests }} ${{ github.event.inputs.extra-params }}
- name: Set test profile to all
run: echo "test_profile=all" >> $GITHUB_ENV
- name: Build integration-tests-common
if: github.event.inputs.skip-tests == 'false'
run: cd registry && ./mvnw install -Pintegration-tests -pl integration-tests/integration-tests-common
- name: Run Integration Tests - sql
if: github.event.inputs.skip-tests == 'false'
run: cd registry && ./mvnw verify -Pintegration-tests -P${{ env.test_profile }} -Psql -pl integration-tests/testsuite -Dmaven.javadoc.skip=true --no-transfer-progress
- name: Run Integration Tests - kafkasql
if: github.event.inputs.skip-tests == 'false'
run: cd registry && ./mvnw verify -Pintegration-tests -P${{ env.test_profile }} -Pkafkasql -pl integration-tests/testsuite -Dmaven.javadoc.skip=true --no-transfer-progress
- name: Run Legacy Tests - sql
if: github.event.inputs.skip-tests == 'false'
run: cd registry && ./mvnw verify -Pintegration-tests -P${{ env.test_profile }} -Psql -pl integration-tests/legacy-tests -Dmaven.javadoc.skip=true --no-transfer-progress
- name: Collect logs
if: failure()
run: ./.github/scripts/collect_logs.sh
- name: Upload tests logs artifacts
if: failure()
uses: actions/[email protected]
with:
name: tests-logs
path: artifacts