-
Notifications
You must be signed in to change notification settings - Fork 7
137 lines (117 loc) · 3.52 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
name: Build
on:
push:
branches: [main]
pull_request:
branches: ["**"]
workflow_call: {}
workflow_dispatch: {}
jobs:
build-x86_64-crossos:
name: jdk-${{ matrix.java-version }}/${{ matrix.os-name }}/x86_64
runs-on: ${{ matrix.os-name }}
strategy:
fail-fast: false
matrix:
os-name: [ubuntu-latest, macos-latest, windows-latest]
java-version: [11, 22]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up JDK ${{ matrix.java-version }}
uses: actions/setup-java@v4
with:
java-version: ${{ matrix.java-version }}
distribution: 'temurin'
cache: maven
# Install protoc onto the PATH so that we can test PATH resolution.
- name: Install dependencies
shell: bash
run: |-
set -eux
case "${{ matrix.os-name }}" in
macos-*)
# Re-enable once brew updates to protoc 26.1 or newer.
#brew install protobuf
#protoc --version
;;
ubuntu-*)
sudo apt update -q
sudo apt install protobuf-compiler -qy
;;
windows-*)
#choco install protoc
#protoc --version
;;
esac
java -version
javac -version
./mvnw --version
- name: Build and test
shell: bash
run: ./mvnw -B verify
- name: Publish code coverage
uses: codecov/codecov-action@v4
continue-on-error: true
if: always()
with:
token: ${{ secrets.CODECOV_TOKEN }}
build-x86_64-linux-oldmaven:
name: jdk-11/ubuntu-latest/x86_64 (oldest supported Maven)
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up JDK 11
uses: actions/setup-java@v4
with:
java-version: 11
distribution: 'temurin'
cache: maven
- name: Change Maven version to the prerequisite version
shell: bash
run: |-
version=$(./mvnw help:evaluate -q \
-Dexpression='project.prerequisites.maven' \
-DforceStdout)
./mvnw wrapper:wrapper -Dmaven="${version}"
- name: Build and test
shell: bash
run: ./mvnw -B verify
- name: Publish code coverage
uses: codecov/codecov-action@v4
continue-on-error: true
if: always()
with:
token: ${{ secrets.CODECOV_TOKEN }}
build-crossarch-linux:
name: jdk-11/ubuntu-latest/${{ matrix.arch }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
arch: [aarch64, ppc64le, s390x]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Build in emulator
uses: uraimo/run-on-arch-action@v2
with:
arch: ${{ matrix.arch }}
distro: ubuntu_latest
# Mount /target so that we can pull the coverage results
dockerRunArgs: '--volume "${PWD}/target:/home/runner/work/target"'
install: |-
set -eux
apt update -q
apt install -qy openjdk-11-jdk-headless protobuf-compiler
java -version
javac -version
protoc --version
run: ./mvnw -B verify
- name: Publish code coverage
uses: codecov/codecov-action@v4
continue-on-error: true
if: always()
with:
token: ${{ secrets.CODECOV_TOKEN }}