-
Notifications
You must be signed in to change notification settings - Fork 100
108 lines (104 loc) · 3.11 KB
/
check-build.yml
File metadata and controls
108 lines (104 loc) · 3.11 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
# Check Build
#
# Description:
# Runs the build for every java version we support
#
# Triggers:
# - pull_request: when a PR is sent to us
# - push: when code is pushed to a specified branch
#
# Notes:
# The matrix build for this workflow is unusual, we need to make it dyanmic since
# we need to change java versions we build for depending on the branch.
on:
workflow_dispatch:
pull_request:
paths:
- 'powertools-batch/**'
- 'powertools-core/**'
- 'powertools-cloudformation/**'
- 'powertools-common/**'
- 'powertools-e2e-tests/**'
- 'powertools-idempotency/**'
- 'powertools-large-messages/**'
- 'powertools-logging/**'
- 'powertools-metrics/**'
- 'powertools-parameters/**'
- 'powertools-serialization/**'
- 'powertools-sqs/**'
- 'powertools-tracing/**'
- 'powertools-tracing/**'
- 'powertools-validation/**'
- 'examples/**'
- 'pom.xml'
- 'examples/pom.xml'
- '.github/workflows/**'
push:
branches:
- main
paths: # add other modules when there are under e2e tests
- 'powertools-batch/**'
- 'powertools-core/**'
- 'powertools-cloudformation/**'
- 'powertools-common/**'
- 'powertools-e2e-tests/**'
- 'powertools-idempotency/**'
- 'powertools-large-messages/**'
- 'powertools-logging/**'
- 'powertools-metrics/**'
- 'powertools-parameters/**'
- 'powertools-serialization/**'
- 'powertools-sqs/**'
- 'powertools-tracing/**'
- 'powertools-tracing/**'
- 'powertools-validation/**'
- 'pom.xml'
- 'examples/**'
- 'examples/pom.xml'
- '.github/workflows/**'
name: Build
run-name: Build - ${{ github.event_name }}
jobs:
setup:
runs-on: ubuntu-latest
outputs:
build_matrix: ${{ format('{0}{1}', steps.build_matrix_v1.outputs.build_matrix, steps.build_matrix_v1.outputs.build_matrix) }}
steps:
- id: base
name: Base
run: |
echo build_version=$(test ${{ github.ref }} == "v2" && echo "v2" || echo "v1") >> $GITHUB_OUTPUT
- id: build_matrix_v1
name: Build matrix (v1)
if: ${{ steps.base.outputs.build_version == 'v1' }}
run: |
echo build_matrix='["8", "11", "17", "21"]' >> "$GITHUB_OUTPUT"
- id: build_matrix_v2
name: Build matrix (v2)
if: ${{ steps.base.outputs.build_version == 'v2' }}
run: |
echo build_matrix='["11", "17", "21"]'>> "$GITHUB_OUTPUT"
build:
runs-on: ubuntu-latest
strategy:
matrix:
java:
- 8
- 11
- 17
- 21
steps:
- id: checkout
name: Checkout repository
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- name: Setup Java
uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00
with:
distribution: corretto
java-version: ${{ matrix.java }}
cache: maven
- id: build-maven
name: Build (Maven)
if: ${{ matrix.java != '8' }}
run: |
mvn -B install --file pom.xml