-
Notifications
You must be signed in to change notification settings - Fork 8
164 lines (141 loc) · 4.3 KB
/
build.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
153
154
155
156
157
158
159
160
161
162
163
164
name: Build
on:
pull_request_target:
branches: [main]
push:
branches: [main]
workflow_dispatch: {}
jobs:
shellcheck:
name: Shellcheck
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Run Shellcheck
uses: ludeeus/action-shellcheck@master
with:
check_together: 'yes'
scandir: ./scripts
validate-codecov:
name: Validate codecov.yml
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Validate codecov.yml
shell: bash
run: curl -vvv --fail --data-binary @- https://codecov.io/validate < codecov.yml
validate-checkstyle-and-license-headers:
name: Checkstyle and license headers
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: 23
distribution: temurin
cache: maven
- name: Validate
shell: bash
run: ./mvnw -B validate
build:
name: JDK ${{ matrix.java-version }} on ${{ matrix.os-name }} (${{ matrix.maven}} Maven)
runs-on: ${{ matrix.os-name }}
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
os-name: [ubuntu-latest]
java-version: [11, 23]
maven: [default]
include:
# Cross-OS tests
- os-name: macos-latest
java-version: 11
maven: default
- os-name: windows-latest
java-version: 11
maven: default
# TODO: uncomment once a Java 24 compatible version of Groovy is available.
# Test on Java 24 early access to verify future compatibility.
#- os-name: ubuntu-latest
# java-version: 24-ea
# maven: default
# Prereq Maven version, to test backwards compatibility.
- os-name: ubuntu-latest
java-version: 11
maven: prerequisite
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: ${{ matrix.java-version }}
distribution: 'temurin'
cache: maven
- name: Change Maven version to the prerequisite version
if: ${{ matrix.maven == 'prerequisite' }}
shell: bash
run: |-
version=$(./mvnw -B -T1 -q -pl protobuf-maven-plugin help:evaluate -DforceStdout -Dexpression='project.prerequisites.maven')
./mvnw -B -T1 -q wrapper:wrapper "-Dmaven=${version}"
- name: Install protoc to $PATH
shell: bash
run: scripts/install-protoc-to-github-runner.sh
- name: Build and test
shell: bash
run: ./mvnw -B -Dcheckstyle.skip -Dlicense.skip verify
- name: Publish code coverage
uses: codecov/codecov-action@v4
continue-on-error: true
if: always()
with:
token: ${{ secrets.CODECOV_TOKEN }}
- name: Upload build logs as artifacts
uses: actions/upload-artifact@v4
if: always()
with:
name: jdk-${{ matrix.java-version }}-${{ matrix.os-name }}-${{ matrix.maven }}
path: |-
**/build.log
**/maven-status/**
**/surefire-reports/**.txt
compression-level: 9
retention-days: 7
include-hidden-files: true
if-no-files-found: warn
pages:
name: Pages
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: 23
distribution: temurin
cache: maven
- name: Build Pages
shell: bash
run: |-
./mvnw -B site \
-Dmaven.test.skip \
-Dinvoker.skip \
-Dcheckstyle.skip \
-Dlicense.skip
- name: Upload generated site as artifacts
uses: actions/upload-artifact@v4
with:
name: site
path: protobuf-maven-plugin/target/site/**
compression-level: 9
retention-days: 7
include-hidden-files: true
if-no-files-found: error