forked from apache/ozone
-
Notifications
You must be signed in to change notification settings - Fork 0
137 lines (134 loc) · 5.21 KB
/
build-ratis.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
# 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.
# This workflow can be called by other workflows to build Ratis.
#
# Inputs:
# - Ratis repo
# - the commit to build
# Outputs:
# - various version numbers that need to be provided to the Ozone build process.
# - Ratis repository is uploaded as an artifact named `ratis-jars`
#
# See `intermittent-test-check.yml` as an example use of this workflow.
name: build-ratis
on:
workflow_call:
inputs:
repo:
description: Ratis repository
default: apache/ratis
required: true
type: string
ref:
description: Ratis ref (branch, tag or commit SHA)
default: master
required: true
type: string
outputs:
ratis-version:
description: "Ratis Version"
value: ${{ jobs.ratis.outputs.ratis-version }}
thirdparty-version:
description: "Ratis Third-Party Version"
value: ${{ jobs.ratis.outputs.thirdparty-version }}
grpc-version:
description: "gRPC Version"
value: ${{ jobs.ratis-thirdparty.outputs.grpc-version }}
netty-version:
description: "Netty Version"
value: ${{ jobs.ratis-thirdparty.outputs.netty-version }}
protobuf-version:
description: "Protobuf Version"
value: ${{ jobs.ratis-thirdparty.outputs.protobuf-version }}
env:
MAVEN_OPTS: -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.http.retryHandler.class=standard -Dmaven.wagon.http.retryHandler.count=3
jobs:
ratis:
runs-on: ubuntu-20.04
timeout-minutes: 60
outputs:
ratis-version: ${{ steps.versions.outputs.ratis }}
thirdparty-version: ${{ steps.versions.outputs.thirdparty }}
steps:
- name: Checkout project
uses: actions/checkout@v4
with:
repository: ${{ inputs.repo }}
ref: ${{ inputs.ref }}
- name: Cache for maven dependencies
uses: actions/cache@v4
with:
path: |
~/.m2/repository
!~/.m2/repository/org/apache/ratis
key: ratis-dependencies-${{ hashFiles('**/pom.xml') }}
- name: Setup java
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 8
- name: Get component versions
id: versions
run: |
thirdparty_version="$(mvn help:evaluate -N -q -DforceStdout -Dscan=false -Dexpression=ratis.thirdparty.version)"
echo "thirdparty=${thirdparty_version}" >> $GITHUB_OUTPUT
ratis_sha=$(git rev-parse --short HEAD)
ratis_version="$(mvn help:evaluate -N -q -DforceStdout -Dscan=false -Dexpression=project.version | sed -e "s/-SNAPSHOT/-${ratis_sha}-SNAPSHOT/")"
echo "ratis=${ratis_version}" >> $GITHUB_OUTPUT
- name: Run a full build
run: |
mvn -B --no-transfer-progress -Dscan=false versions:set -DnewVersion=${{ steps.versions.outputs.ratis }}
dev-support/checks/build.sh
- name: Store Maven repo for tests
uses: actions/upload-artifact@v4
with:
name: ratis-jars
path: |
~/.m2/repository/org/apache/ratis
retention-days: 1
ratis-thirdparty:
runs-on: ubuntu-20.04
needs:
- ratis
timeout-minutes: 30
outputs:
grpc-version: ${{ steps.versions.outputs.grpc }}
netty-version: ${{ steps.versions.outputs.netty }}
protobuf-version: ${{ steps.versions.outputs.protobuf }}
steps:
- name: Checkout project
uses: actions/checkout@v4
with:
repository: apache/ratis-thirdparty
ref: ${{ needs.ratis.outputs.thirdparty-version }}
- name: Get component versions
id: versions
run: |
echo "grpc=$(mvn help:evaluate -N -q -DforceStdout -Dscan=false -Dexpression=shaded.grpc.version)" >> $GITHUB_OUTPUT
echo "netty=$(mvn help:evaluate -N -q -DforceStdout -Dscan=false -Dexpression=shaded.netty.version)" >> $GITHUB_OUTPUT
echo "protobuf=$(mvn help:evaluate -N -q -DforceStdout -Dscan=false -Dexpression=shaded.protobuf.version)" >> $GITHUB_OUTPUT
debug:
runs-on: ubuntu-20.04
needs:
- ratis
- ratis-thirdparty
steps:
- name: Print versions
run: |
echo ${{ needs.ratis.outputs.ratis-version }}
echo ${{ needs.ratis.outputs.thirdparty-version }}
echo ${{ needs.ratis-thirdparty.outputs.grpc-version }}
echo ${{ needs.ratis-thirdparty.outputs.netty-version }}
echo ${{ needs.ratis-thirdparty.outputs.protobuf-version }}