Skip to content

Commit d8ffbf1

Browse files
darklight3itDavide Melfi
andauthored
Github Actions Improvements (#594)
* ci: 🚚 Github Actions improvements * ci: dependent library test fan out * ci: add workflow_dispatch * build: upgrading junit-jupiter everywhere --------- Co-authored-by: Davide Melfi <dmelfi@amazon.com>
1 parent c201b4d commit d8ffbf1

File tree

17 files changed

+74
-63
lines changed

17 files changed

+74
-63
lines changed

.github/workflows/aws-lambda-java-core.yml

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
# This workflow will be triggered if there will be changes to aws-lambda-java-core
2-
# package and it builds the package and the packages that depend on it.
2+
# package and it builds the package.
33

44
name: Java CI aws-lambda-java-core
55

66
on:
7+
workflow_dispatch:
78
push:
89
branches: [ main ]
910
paths:
@@ -29,18 +30,7 @@ jobs:
2930
with:
3031
java-version: 8
3132
distribution: corretto
32-
33-
# Install base module
33+
cache: maven
34+
3435
- name: Install core with Maven
3536
run: mvn -B install --file aws-lambda-java-core/pom.xml
36-
37-
# Package modules that depend on base module
38-
- name: Package log4j2 with Maven
39-
run: mvn -B package --file aws-lambda-java-log4j2/pom.xml
40-
41-
# Test Runtime Interface Client
42-
- name: Run 'pr' target
43-
working-directory: ./aws-lambda-java-runtime-interface-client
44-
run: make pr
45-
env:
46-
IS_JAVA_8: true

.github/workflows/aws-lambda-java-events-sdk-transformer.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,21 @@
1-
# This workflow will be triggered if there will be changes to
2-
# aws-lambda-java-events-sdk-transformer package and it builds the package.
1+
# This workflow will be triggered if there will be changes to
2+
# aws-lambda-java-events-sdk-transformer package or its dependency (events),
3+
# and it builds the package.
34

45
name: Java CI aws-lambda-java-events-sdk-transformer
56

67
on:
8+
workflow_dispatch:
79
push:
810
branches: [ main ]
911
paths:
1012
- 'aws-lambda-java-events-sdk-transformer/**'
13+
- 'aws-lambda-java-events/**'
1114
pull_request:
1215
branches: [ '*' ]
1316
paths:
1417
- 'aws-lambda-java-events-sdk-transformer/**'
18+
- 'aws-lambda-java-events/**'
1519
- '.github/workflows/aws-lambda-java-events-sdk-transformer.yml'
1620

1721
permissions:
@@ -29,11 +33,11 @@ jobs:
2933
with:
3034
java-version: 8
3135
distribution: corretto
36+
cache: maven
3237

33-
# Install base module
38+
# Install dependency
3439
- name: Install events with Maven
3540
run: mvn -B install --file aws-lambda-java-events/pom.xml
3641
# Package target module
3742
- name: Package events-sdk-transformer with Maven
3843
run: mvn -B package --file aws-lambda-java-events-sdk-transformer/pom.xml
39-

.github/workflows/aws-lambda-java-events.yml

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
# This workflow will be triggered if there will be changes to aws-lambda-java-events
2-
# package and it builds the package and the packages that depend on it.
2+
# package and it builds the package.
33

44
name: Java CI aws-lambda-java-events
55

66
on:
7+
workflow_dispatch:
78
push:
89
branches: [ main ]
910
paths:
@@ -29,14 +30,7 @@ jobs:
2930
with:
3031
java-version: 8
3132
distribution: corretto
32-
33-
# Install base module
33+
cache: maven
34+
3435
- name: Install events with Maven
3536
run: mvn -B install --file aws-lambda-java-events/pom.xml
36-
37-
# Package modules that depend on base module
38-
- name: Package serialization with Maven
39-
run: mvn -B package --file aws-lambda-java-serialization/pom.xml
40-
- name: Package events-sdk-transformer with Maven
41-
run: mvn -B package --file aws-lambda-java-events-sdk-transformer/pom.xml
42-

.github/workflows/aws-lambda-java-log4j2.yml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,20 @@
1-
# This workflow will be triggered if there will be changes to
2-
# aws-lambda-java-log4j2 package and it builds the package.
1+
# This workflow will be triggered if there will be changes to
2+
# aws-lambda-java-log4j2 package or its dependency (core), and it builds the package.
33

44
name: Java CI aws-lambda-java-log4j2
55

66
on:
77
push:
8+
workflow_dispatch:
89
branches: [ main ]
910
paths:
1011
- 'aws-lambda-java-log4j2/**'
12+
- 'aws-lambda-java-core/**'
1113
pull_request:
1214
branches: [ '*' ]
1315
paths:
1416
- 'aws-lambda-java-log4j2/**'
17+
- 'aws-lambda-java-core/**'
1518
- '.github/workflows/aws-lambda-java-log4j2.yml'
1619

1720
permissions:
@@ -29,11 +32,11 @@ jobs:
2932
with:
3033
java-version: 8
3134
distribution: corretto
32-
33-
# Install base module
35+
cache: maven
36+
37+
# Install dependency
3438
- name: Install core with Maven
3539
run: mvn -B install --file aws-lambda-java-core/pom.xml
3640
# Package target module
3741
- name: Package log4j2 with Maven
3842
run: mvn -B package --file aws-lambda-java-log4j2/pom.xml
39-

.github/workflows/aws-lambda-java-profiler.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ jobs:
2929
with:
3030
java-version: 21
3131
distribution: corretto
32+
cache: maven
3233

3334
- name: Issue AWS credentials
3435
uses: aws-actions/configure-aws-credentials@v4

.github/workflows/aws-lambda-java-serialization.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,20 @@
1-
# This workflow will be triggered if there will be changes to aws-lambda-java-serialization
2-
# package and it builds the package and the packages that depend on it.
1+
# This workflow will be triggered if there will be changes to aws-lambda-java-serialization
2+
# package or its dependency (events), and it builds the package.
33

44
name: Java CI aws-lambda-java-serialization
55

66
on:
7+
workflow_dispatch:
78
push:
89
branches: [ main ]
910
paths:
1011
- 'aws-lambda-java-serialization/**'
12+
- 'aws-lambda-java-events/**'
1113
pull_request:
1214
branches: [ '*' ]
1315
paths:
1416
- 'aws-lambda-java-serialization/**'
17+
- 'aws-lambda-java-events/**'
1518
- '.github/workflows/aws-lambda-java-serialization.yml'
1619

1720
permissions:
@@ -29,8 +32,9 @@ jobs:
2932
with:
3033
java-version: 8
3134
distribution: corretto
32-
33-
# Install base module
35+
cache: maven
36+
37+
# Install dependency
3438
- name: Install events with Maven
3539
run: mvn -B install --file aws-lambda-java-events/pom.xml
3640

.github/workflows/aws-lambda-java-tests.yml

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# This workflow will be triggered if there will be changes to aws-lambda-java-tests
2-
# package and it builds the package and the packages that depend on it.
2+
# package or its dependencies (events, serialization), and it builds the package.
33

44
name: Java CI aws-lambda-java-tests
55

@@ -9,16 +9,14 @@ on:
99
branches: [ main ]
1010
paths:
1111
- 'aws-lambda-java-tests/**'
12-
- 'aws-lambda-java-runtime-interface-client/**'
13-
- 'aws-lambda-java-serialization/**'
1412
- 'aws-lambda-java-events/**'
13+
- 'aws-lambda-java-serialization/**'
1514
pull_request:
1615
branches: [ '*' ]
1716
paths:
1817
- 'aws-lambda-java-tests/**'
19-
- 'aws-lambda-java-runtime-interface-client/**'
20-
- 'aws-lambda-java-serialization/**'
2118
- 'aws-lambda-java-events/**'
19+
- 'aws-lambda-java-serialization/**'
2220
- '.github/workflows/aws-lambda-java-tests.yml'
2321

2422
permissions:
@@ -36,8 +34,9 @@ jobs:
3634
with:
3735
java-version: 8
3836
distribution: corretto
39-
40-
# Install base module
37+
cache: maven
38+
39+
# Install dependencies
4140
- name: Install events with Maven
4241
run: mvn -B install --file aws-lambda-java-events/pom.xml
4342
- name: Install serialization with Maven
@@ -46,4 +45,3 @@ jobs:
4645
# Package target module
4746
- name: Package tests with Maven
4847
run: mvn -B package --file aws-lambda-java-tests/pom.xml
49-

.github/workflows/runtime-interface-client_merge_to_main.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@
1111
name: Publish artifact for aws-lambda-java-runtime-interface-client
1212

1313
on:
14+
workflow_dispatch:
1415
push:
1516
branches: [ main ]
1617
paths:
1718
- 'aws-lambda-java-runtime-interface-client/**'
1819
- '.github/workflows/runtime-interface-client_*.yml'
19-
workflow_dispatch:
2020

2121
jobs:
2222

@@ -35,6 +35,7 @@ jobs:
3535
with:
3636
java-version: 8
3737
distribution: corretto
38+
cache: maven
3839

3940
- name: Set up QEMU
4041
uses: docker/setup-qemu-action@v3

.github/workflows/runtime-interface-client_pr.yml

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
1-
# This workflow will be triggered if there will be changes to
2-
# aws-lambda-java-runtime-interface-client package and it builds the package.
1+
# This workflow will be triggered if there will be changes to
2+
# aws-lambda-java-runtime-interface-client package or its dependencies (core, serialization),
3+
# and it builds the package.
34

45
name: PR to runtime-interface-client
56

67
on:
8+
workflow_dispatch:
79
pull_request:
810
branches: [ '*' ]
911
paths:
1012
- 'aws-lambda-java-runtime-interface-client/**'
13+
- 'aws-lambda-java-core/**'
14+
- 'aws-lambda-java-serialization/**'
1115
- '.github/workflows/runtime-interface-client_*.yml'
1216

1317
permissions:
@@ -25,7 +29,8 @@ jobs:
2529
with:
2630
java-version: 8
2731
distribution: corretto
28-
32+
cache: maven
33+
2934
- name: Build and install core dependency locally
3035
working-directory: ./aws-lambda-java-core
3136
run: mvn clean install
@@ -39,7 +44,7 @@ jobs:
3944
run: make pr
4045
env:
4146
IS_JAVA_8: true
42-
47+
4348
build:
4449
runs-on: ubuntu-latest
4550
steps:
@@ -50,6 +55,7 @@ jobs:
5055
with:
5156
java-version: 8
5257
distribution: corretto
58+
cache: maven
5359

5460
- name: Set up QEMU
5561
uses: docker/setup-qemu-action@v3
@@ -61,7 +67,7 @@ jobs:
6167

6268
- name: Available buildx platforms
6369
run: echo ${{ steps.buildx.outputs.platforms }}
64-
70+
6571
- name: Build and install core dependency locally
6672
working-directory: ./aws-lambda-java-core
6773
run: mvn clean install

.github/workflows/samples.yml

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,24 @@
1-
# This workflow will be triggered if there will be changes to aws-lambda-java-core
2-
# package and it builds the package and the packages that depend on it.
1+
# This workflow will be triggered if there will be changes to samples
2+
# or their dependencies (events, serialization, tests).
33

44
name: Java CI samples
55

66
on:
7+
workflow_dispatch:
78
push:
89
branches: [ main ]
910
paths:
1011
- 'samples/**'
12+
- 'aws-lambda-java-events/**'
13+
- 'aws-lambda-java-serialization/**'
14+
- 'aws-lambda-java-tests/**'
1115
pull_request:
1216
branches: [ '*' ]
1317
paths:
1418
- 'samples/**'
19+
- 'aws-lambda-java-events/**'
20+
- 'aws-lambda-java-serialization/**'
21+
- 'aws-lambda-java-tests/**'
1522
- '.github/workflows/samples.yml'
1623

1724
permissions:
@@ -27,14 +34,13 @@ jobs:
2734
with:
2835
java-version: 8
2936
distribution: corretto
37+
cache: maven
3038

31-
# Install events module
39+
# Install dependencies
3240
- name: Install events with Maven
3341
run: mvn -B install --file aws-lambda-java-events/pom.xml
34-
# Install serialization module
3542
- name: Install serialization with Maven
3643
run: mvn -B install --file aws-lambda-java-serialization/pom.xml
37-
# Install tests module
3844
- name: Install tests with Maven
3945
run: mvn -B install --file aws-lambda-java-tests/pom.xml
4046

@@ -54,6 +60,7 @@ jobs:
5460
8
5561
21
5662
distribution: corretto
63+
cache: maven
5764

5865
# Install events module using Java 8
5966
- name: Install events with Maven

0 commit comments

Comments
 (0)