-
Notifications
You must be signed in to change notification settings - Fork 242
Expand file tree
/
Copy pathruntime-interface-client_merge_to_main.yml
More file actions
147 lines (125 loc) · 4.99 KB
/
Copy pathruntime-interface-client_merge_to_main.yml
File metadata and controls
147 lines (125 loc) · 4.99 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
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
# This workflow will be triggered on merge to the main branch if
# aws-lambda-java-runtime-interface-client package was changed
#
# It will publish artifacts to CodeArtifact repository, specified by properties defined in GitHub repo secrets:
# CODE_ARTIFACT_REPO_ACCOUNT, AWS_REGION, CODE_ARTIFACT_REPO_NAME, CODE_ARTIFACT_DOMAIN
# and will assume role specified by AWS_ROLE
#
# Prerequisite setup:
# https://docs.github.com/en/actions/deployment/security-hardening-your-deployments/configuring-openid-connect-in-amazon-web-services
name: Publish artifact for aws-lambda-java-runtime-interface-client
on:
workflow_dispatch:
push:
branches: [ main ]
paths:
- 'aws-lambda-java-runtime-interface-client/**'
- '.github/workflows/runtime-interface-client_*.yml'
jobs:
publish:
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- name: Set up JDK 1.8
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5
with:
java-version: 8
distribution: corretto
cache: maven
- name: Set up QEMU
uses: docker/setup-qemu-action@c7c53464625b32c7a7e944ae62b3e17d2b600130 # v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3
with:
install: true
- name: Available buildx platforms
run: echo ${{ steps.buildx.outputs.platforms }}
- name: Build and install serialization dependency locally
working-directory: ./aws-lambda-java-serialization
run: mvn clean install
- name: Test Runtime Interface Client xplatform build - Run 'build' target
working-directory: ./aws-lambda-java-runtime-interface-client
run: make build
env:
IS_JAVA_8: true
- name: Issue AWS credentials
if: env.ENABLE_SNAPSHOT != null
env:
ENABLE_SNAPSHOT: ${{ secrets.ENABLE_SNAPSHOT }}
uses: aws-actions/configure-aws-credentials@7474bc4690e29a8392af63c5b98e7449536d5c3a # v4
with:
aws-region: ${{ secrets.AWS_REGION }}
role-to-assume: ${{ secrets.AWS_ROLE }}
role-session-name: GitHubActionsPublishPackage
role-duration-seconds: 900
- name: Prepare codeartifact properties
if: env.ENABLE_SNAPSHOT != null
env:
ENABLE_SNAPSHOT: ${{ secrets.ENABLE_SNAPSHOT }}
working-directory: ./aws-lambda-java-runtime-interface-client/ric-dev-environment
run: |
cat <<EOF > codeartifact-properties.mk
CODE_ARTIFACT_REPO_ACCOUNT=${{ secrets.AWS_ACCOUNT }}
CODE_ARTIFACT_REPO_REGION=${{ env.AWS_REGION }}
CODE_ARTIFACT_REPO_NAME=${{ secrets.CODE_ARTIFACT_REPO_NAME }}
CODE_ARTIFACT_DOMAIN=${{ secrets.AWS_CODEARTIFACT_DOMAIN }}
EOF
- name: Publish
if: env.ENABLE_SNAPSHOT != null
working-directory: ./aws-lambda-java-runtime-interface-client
env:
ENABLE_SNAPSHOT: ${{ secrets.ENABLE_SNAPSHOT }}
run: make publish
# Coverage is measured on both native architectures (x86_64 and aarch64) so
# the coverage recorded for a merge to main matches what the PR build recorded
# (the union of both archs). Uploading a single x86_64 report here previously
# made every merge commit look ~0.4% lower than its own PR base, failing the
# codecov/project status on identical code.
coverage:
permissions:
contents: read
strategy:
fail-fast: false
matrix:
include:
- arch: x86_64
runner: ubuntu-latest
- arch: aarch64
runner: ubuntu-24.04-arm
runs-on: ${{ matrix.runner }}
name: "coverage (${{ matrix.arch }})"
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- name: Set up JDK 1.8
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5
with:
java-version: 8
distribution: corretto
cache: maven
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3
with:
install: true
- name: Build and install core dependency locally
working-directory: ./aws-lambda-java-core
run: mvn clean install
- name: Build and install serialization dependency locally
working-directory: ./aws-lambda-java-serialization
run: mvn clean install
- name: Build Runtime Interface Client - Run 'build-${{ matrix.arch }}' target
working-directory: ./aws-lambda-java-runtime-interface-client
run: make build-${{ matrix.arch }}
env:
IS_JAVA_8: true
- name: Upload coverage to Codecov
if: env.CODECOV_TOKEN != null
uses: codecov/codecov-action@75cd11691c0faa626561e295848008c8a7dddffe # v5
with:
files: ./aws-lambda-java-runtime-interface-client/target/site/jacoco/jacoco.xml
flags: ${{ matrix.arch }}
disable_search: true
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}