-
Notifications
You must be signed in to change notification settings - Fork 439
166 lines (156 loc) · 4.9 KB
/
ci.yaml
File metadata and controls
166 lines (156 loc) · 4.9 KB
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
153
154
155
156
157
158
159
160
161
162
163
164
165
166
# 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: CI
on:
workflow_call:
inputs:
ref:
type: string
description: Ratis git ref (branch, tag or commit hash)
default: ''
required: false
secrets:
DEVELOCITY_ACCESS_KEY:
description: 'Token for submitting build scan to Develocity'
required: false
SONARCLOUD_TOKEN:
description: 'Token for submitting coverage data to SonarCloud'
required: false
permissions: { }
jobs:
build:
uses: ./.github/workflows/check.yaml
with:
script: build
script-args: -Prelease
timeout-minutes: 30
secrets:
DEVELOCITY_ACCESS_KEY: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
compile:
needs:
- build
strategy:
matrix:
java: [ 8, 11, 17, 21 ]
fail-fast: false
uses: ./.github/workflows/check.yaml
with:
java-version: ${{ matrix.java }}
needs-source-tarball: true
script: compile
script-args: -Dmaven.compiler.release=${{ matrix.java }}
split: ${{ matrix.java }}
timeout-minutes: 30
secrets:
DEVELOCITY_ACCESS_KEY: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
release:
uses: ./.github/workflows/check.yaml
with:
script: release
timeout-minutes: 30
secrets:
DEVELOCITY_ACCESS_KEY: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
repro:
needs:
- build
uses: ./.github/workflows/check.yaml
with:
needs-maven-repo: true
script: repro
script-args: -Prelease
timeout-minutes: 30
secrets:
DEVELOCITY_ACCESS_KEY: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
basic:
strategy:
matrix:
check:
- author
- checkstyle
- findbugs
- rat
fail-fast: false
uses: ./.github/workflows/check.yaml
with:
script: ${{ matrix.check }}
timeout-minutes: 30
secrets:
DEVELOCITY_ACCESS_KEY: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
unit:
strategy:
matrix:
profile:
- grpc
- server
- misc
- flaky
fail-fast: false
uses: ./.github/workflows/check.yaml
with:
script: unit
script-args: -P${{ matrix.profile }}-tests
split: ${{ matrix.profile }}
timeout-minutes: 60
secrets:
DEVELOCITY_ACCESS_KEY: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
coverage:
needs:
- build
- unit
runs-on: ubuntu-24.04
timeout-minutes: 30
if: github.event_name != 'pull_request'
steps:
- name: Checkout project
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0
persist-credentials: false
- name: Cache for maven dependencies
uses: actions/cache/restore@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
with:
path: |
~/.m2/repository
!~/.m2/repository/org/apache/ratis
key: maven-repo-${{ hashFiles('**/pom.xml') }}
restore-keys: |
maven-repo-
- name: Setup java 17
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0
with:
distribution: 'temurin'
java-version: 17
- name: Download artifacts
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
path: target/artifacts
- name: Untar binaries
run: |
mkdir -p ratis-assembly/target
tar xzvf target/artifacts/ratis-bin/ratis-assembly-*.tar.gz -C ratis-assembly/target
- name: Calculate combined coverage
run: ./dev-support/checks/coverage.sh
- name: Upload coverage to Sonar
if: github.repository == 'apache/ratis'
run: ./dev-support/checks/sonar.sh
env:
SONAR_TOKEN: ${{ secrets.SONARCLOUD_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Archive build results
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
if: always()
with:
name: ${{ github.job }}
path: target/${{ github.job }}