forked from apache/camel-quarkus
-
Notifications
You must be signed in to change notification settings - Fork 0
118 lines (111 loc) · 3.86 KB
/
ci-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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
name: Camel Quarkus CI
on:
push:
branches:
- main
- camel-main
- quarkus-main
- "[0-9]+.[0-9]+.x"
paths-ignore:
- '**.adoc'
- '**.md'
- 'Jenkinsfile'
- 'Jenkinsfile.*'
- 'KEYS'
- 'LICENSE.txt'
- 'NOTICE.txt'
- 'camel-quarkus-sbom/**'
pull_request:
branches:
- main
- camel-main
- quarkus-main
- "[0-9]+.[0-9]+.x"
paths-ignore:
- '**.adoc'
- '**.md'
- 'Jenkinsfile'
- 'Jenkinsfile.*'
- 'KEYS'
- 'LICENSE.txt'
- 'NOTICE.txt'
concurrency:
group: ${{ github.ref }}-${{ github.workflow }}
cancel-in-progress: true
env:
LANG: en_US.UTF-8
MAVEN_OPTS: -Xmx3000m
CQ_MAVEN_ARGS: -V -ntp -e -Daether.connector.http.connectionMaxTtl=120
TESTCONTAINERS_RYUK_DISABLED: true
CHECKOUT_REF: ${{ github.event_name == 'pull_request' && github.actor == 'dependabot[bot]' && github.head_ref || '' }}
jobs:
pre-build-checks:
if: github.repository == 'jamesnetherton/camel-quarkus'
runs-on: ubuntu-latest
outputs:
continue-build: ${{ steps.pre-build-checks.outputs.continue-build }}
run-checks: ${{ steps.init.outputs.run-checks }}
steps:
- name: Initialize
id: init
run: |
if [[ "${{ github.event_name }}" == "pull_request" ]] && [[ "${{ github.actor }}" == "dependabot[bot]" ]]; then
echo "run-checks=true" >> $GITHUB_OUTPUT
else
echo "run-checks=false" >> $GITHUB_OUTPUT
fi
- name: Set up JDK 17
uses: actions/setup-java@v4
if: steps.init.outputs.run-checks == 'true'
with:
distribution: 'temurin'
java-version: '17'
- name: Checkout
uses: actions/checkout@v4
if: steps.init.outputs.run-checks == 'true'
with:
ref: ${{ env.CHECKOUT_REF }}
fetch-depth: 0
- name: Pre build checks
id: pre-build-checks
run: |
if [[ "${{ steps.init.outputs.run-checks }}" == "true" ]]; then
./mvnw cq:sync-versions -N ${CQ_MAVEN_ARGS}
./mvnw clean install -pl poms/bom -am -Dcq.flatten-bom.format --fail-never ${CQ_MAVEN_ARGS}
./mvnw clean install -f poms/bom ${CQ_MAVEN_ARGS}
./mvnw clean validate -pl docs ${CQ_MAVEN_ARGS}
if [[ -z "$(git status --porcelain)" ]]; then
echo "continue-build=true" >> $GITHUB_OUTPUT
else
mkdir ./dependabot-pr
echo ${{ github.head_ref }} > ./dependabot-pr/BRANCH_REF
echo "$GITHUB_REF" | awk -F / '{print $3}' > ./dependabot-pr/PR_NUMBER
git diff -p --binary > ./dependabot-pr/changes.patch
echo "continue-build=false" >> $GITHUB_OUTPUT
fi
else
echo "continue-build=true" >> $GITHUB_OUTPUT
fi
- name: Upload dependabot changeset
uses: actions/upload-artifact@v4
if: steps.pre-build-checks.outputs.continue-build == 'false'
with:
name: dependabot-pr-changeset
path: dependabot-pr/
retention-days: 1