Skip to content

Commit 8af7655

Browse files
authored
feat: add conditions around CodeArtifact publishing and CodeCov (#504)
1 parent 0e46a2c commit 8af7655

File tree

2 files changed

+18
-3
lines changed

2 files changed

+18
-3
lines changed

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

+14
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ on:
1515
branches: [ main ]
1616
paths:
1717
- 'aws-lambda-java-runtime-interface-client/**'
18+
- '.github/workflows/runtime-interface-client_*.yml'
1819
workflow_dispatch:
1920

2021
jobs:
@@ -53,6 +54,9 @@ jobs:
5354
IS_JAVA_8: true
5455

5556
- name: Issue AWS credentials
57+
if: env.ENABLE_SNAPSHOT != null
58+
env:
59+
ENABLE_SNAPSHOT: ${{ secrets.ENABLE_SNAPSHOT }}
5660
uses: aws-actions/configure-aws-credentials@v4
5761
with:
5862
aws-region: ${{ secrets.AWS_REGION }}
@@ -61,6 +65,9 @@ jobs:
6165
role-duration-seconds: 900
6266

6367
- name: Prepare codeartifact properties
68+
if: env.ENABLE_SNAPSHOT != null
69+
env:
70+
ENABLE_SNAPSHOT: ${{ secrets.ENABLE_SNAPSHOT }}
6471
working-directory: ./aws-lambda-java-runtime-interface-client/ric-dev-environment
6572
run: |
6673
cat <<EOF > codeartifact-properties.mk
@@ -71,7 +78,14 @@ jobs:
7178
EOF
7279
7380
- name: Publish
81+
if: env.ENABLE_SNAPSHOT != null
7482
working-directory: ./aws-lambda-java-runtime-interface-client
7583
env:
7684
ENABLE_SNAPSHOT: ${{ secrets.ENABLE_SNAPSHOT }}
7785
run: make publish
86+
87+
- name: Upload coverage to Codecov
88+
if: env.CODECOV_TOKEN != null
89+
uses: codecov/codecov-action@v4
90+
env:
91+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

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

+4-3
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88
branches: [ '*' ]
99
paths:
1010
- 'aws-lambda-java-runtime-interface-client/**'
11-
- '.github/workflows/runtime-interface-client_pr.yml'
11+
- '.github/workflows/runtime-interface-client_*.yml'
1212

1313
jobs:
1414

@@ -50,20 +50,21 @@ jobs:
5050

5151
- name: Available buildx platforms
5252
run: echo ${{ steps.buildx.outputs.platforms }}
53-
53+
5454
- name: Test Runtime Interface Client xplatform build - Run 'build' target
5555
working-directory: ./aws-lambda-java-runtime-interface-client
5656
run: make build
5757
env:
5858
IS_JAVA_8: true
59-
59+
6060
- name: Save the built jar
6161
uses: actions/upload-artifact@v4
6262
with:
6363
name: aws-lambda-java-runtime-interface-client
6464
path: ./aws-lambda-java-runtime-interface-client/target/aws-lambda-java-runtime-interface-client-*.jar
6565

6666
- name: Upload coverage to Codecov
67+
if: env.CODECOV_TOKEN != null
6768
uses: codecov/codecov-action@v4
6869
env:
6970
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

0 commit comments

Comments
 (0)