Skip to content

Commit 9e615f5

Browse files
committed
Merge main into mldsa-native-import - Keep deletion of ml_dsa_ref/sign.c as it's replaced by native implementation
2 parents 2990010 + 31cb153 commit 9e615f5

File tree

79 files changed

+9011
-4710
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

79 files changed

+9011
-4710
lines changed
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
# SPDX-License-Identifier: Apache-2.0 OR ISC
3+
4+
name: 'check-authorization'
5+
description: 'A helper action to determine the authorization level of a pull request for running CI'
6+
outputs:
7+
approval-env:
8+
description: 'The target environment to use for the workflow'
9+
value: ${{ steps.collab-check.outputs.result }}
10+
runs:
11+
using: 'composite'
12+
steps:
13+
- name: Collaborator Check
14+
uses: actions/github-script@v8
15+
id: collab-check
16+
with:
17+
result-encoding: string
18+
script: |
19+
// Skip authorization check if event is not pull_request_target
20+
if (context.eventName !== 'pull_request_target') {
21+
console.log(`Event type is ${context.eventName}, skipping authorization check`);
22+
return null;
23+
}
24+
25+
try {
26+
const permissionResponse = await github.rest.repos.getCollaboratorPermissionLevel({
27+
owner: context.repo.owner,
28+
repo: context.repo.repo,
29+
username: context.payload.pull_request.user.login,
30+
});
31+
const permission = permissionResponse.data.permission;
32+
const hasWriteAccess = ['write', 'admin'].includes(permission);
33+
if (!hasWriteAccess) {
34+
console.log(`User ${context.payload.pull_request.user.login} does not have write access to the repository (permission: ${permission})`);
35+
return "manual-approval"
36+
} else {
37+
console.log(`Verifed ${context.payload.pull_request.user.login} has write access. Auto Approving PR Checks.`)
38+
return "auto-approve"
39+
}
40+
} catch (error) {
41+
console.log(`${context.payload.pull_request.user.login} does not have write access. Requiring Manual Approval to run PR Checks.`)
42+
return "manual-approval"
43+
}

.github/actions/codebuild-docker-run/action.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@ inputs:
2424
ipv6:
2525
description: 'Enables IPv6 networking in the container. Implies --privileged'
2626
required: false
27-
default: false
27+
default: 'false'
2828
withCredentials:
2929
description: 'Whether to passthru the CodeBuild credentials'
3030
required: false
31-
default: false
31+
default: 'false'
3232
user:
3333
description: 'Run the docker container as a non-root user'
3434
required: false

.github/actions/codebuild-docker-run/codebuild-docker-run.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ fi
5050

5151
PASSTHRU_ENV_VARS=("GOPROXY" "AWS_DEFAULT_REGION" "AWS_REGION")
5252

53-
if [[ "${INPUT_WITH_CREDENTIALS}" == true ]] &&
53+
if [[ "${INPUT_WITH_CREDENTIALS}" == "true" ]] &&
5454
[[ ! "${ENV_FLAGS}" =~ ECS_CONTAINER_METADATA_URI_V4 ]] &&
5555
[[ ! "${ENV_FLAGS}" =~ AWS_CONTAINER_CREDENTIALS_RELATIVE_URI ]]; then
5656
PASSTHRU_ENV_VARS+=(ECS_CONTAINER_METADATA_URI_V4 AWS_CONTAINER_CREDENTIALS_RELATIVE_URI)
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
# SPDX-License-Identifier: Apache-2.0 OR ISC
3+
4+
name: 'configure-aws-credentials'
5+
description: 'A helper for configure AWS credentials for AWS-LC GitHub actions'
6+
inputs:
7+
roleName:
8+
description: "The target IAM role to assume using the OIDC role credentials"
9+
required: true
10+
default: 'AwsLcGitHubActionStandardRole'
11+
runs:
12+
using: 'composite'
13+
steps:
14+
- name: Query Environment
15+
id: env
16+
shell: bash
17+
run: |
18+
echo aws_account_id=${AWS_ACCOUNT_ID} >> "$GITHUB_OUTPUT"
19+
- name: Retrieve OIDC Role Credentials
20+
uses: aws-actions/configure-aws-credentials@v5
21+
with:
22+
role-to-assume: arn:aws:iam::${{ steps.env.outputs.aws_account_id }}:role/AwsLcGitHubActionsOidcRole
23+
role-session-name: ${{ github.run_id }}-${{ github.run_attempt }}
24+
- name: Retrieve GitHub Actions Role Credentials
25+
uses: aws-actions/configure-aws-credentials@v5
26+
with:
27+
role-to-assume: arn:aws:iam::${{ steps.env.outputs.aws_account_id }}:role/${{ inputs.roleName }}
28+
role-session-name: ${{ github.run_id }}-${{ github.run_attempt }}
29+
role-chaining: true
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
# SPDX-License-Identifier: Apache-2.0 OR ISC
3+
4+
FROM public.ecr.aws/ubuntu/ubuntu:24.04 AS base
5+
6+
SHELL ["/bin/bash", "-c"]
7+
8+
ENV DEBIAN_FRONTEND=noninteractive
9+
10+
11+
ENV ANDROID_SDK_URL=commandlinetools-linux-13114758_latest
12+
ENV ANDROID_HOME=/opt/sdk
13+
ENV ANDROID_SDK_ROOT=/opt/sdk
14+
ENV GRADLE_VERSION=gradle-7.6.4
15+
ENV GOROOT=/usr/local/go
16+
ENV PATH="$GOROOT/bin:/opt/sdk/cmdline-tools/latest/bin:$PATH"
17+
# ------------------------------------------------------
18+
# --- Android SDK
19+
20+
RUN <<EOF
21+
set -ex
22+
apt-get update -y
23+
apt-get -y --no-install-recommends upgrade
24+
apt-get -y --no-install-recommends install \
25+
git \
26+
libunwind-dev \
27+
openjdk-17-jdk \
28+
perl \
29+
python3.12 \
30+
python3.12-venv \
31+
python3-pip \
32+
unzip \
33+
wget
34+
EOF
35+
36+
# Setup Android SDK
37+
RUN <<EOF
38+
# Set Java 17 as default
39+
export JAVA17_ALT=$(update-alternatives --list java | grep java-17 | head -1)
40+
update-alternatives --set java $JAVA17_ALT
41+
42+
# Set Java 17 for SDK manager compatibility
43+
export JAVA_HOME=$(find /usr/lib/jvm -name "*java-17*" -type d | head -1)
44+
export PATH=$JAVA_HOME/bin:$PATH
45+
46+
# install android-sdk from url source
47+
mkdir /opt/sdk
48+
mkdir /opt/sdk/cmdline-tools
49+
mkdir /opt/cmdline-tools-tmp
50+
cd /opt/cmdline-tools-tmp
51+
wget -q https://dl.google.com/android/repository/${ANDROID_SDK_URL}.zip
52+
unzip ${ANDROID_SDK_URL}.zip
53+
54+
# move to its final location and export path
55+
mv ./cmdline-tools ${ANDROID_HOME}/cmdline-tools/latest
56+
cd $ANDROID_HOME/cmdline-tools/latest/bin
57+
./sdkmanager --update
58+
yes | ./sdkmanager --licenses
59+
60+
# Preinstall AWSLCAndroidTestRunner android dependencies, so they don't need to be
61+
# rebuilt for each new gradle build run.
62+
./sdkmanager "ndk;28.2.13676358" \
63+
"build-tools;33.0.3" \
64+
"cmake;3.18.1" \
65+
"platforms;android-30"
66+
67+
cd /opt
68+
wget -q https://services.gradle.org/distributions/${GRADLE_VERSION}-all.zip
69+
rm -rf /opt/cmdline-tools-tmp
70+
rm -rf /tmp/*
71+
EOF
72+
73+
# Preinstall gradle dependencies, so they don't need to be redownloaded in the CI.
74+
COPY . /tmp/triggerGradleDownloads/
75+
76+
RUN <<EOF
77+
cd /tmp/triggerGradleDownloads
78+
echo "JAVA_HOME=$JAVA_HOME"
79+
java -version
80+
echo "PATH=$PATH"
81+
./gradlew --no-daemon --refresh-dependencies androidDependencies lint
82+
EOF
83+
84+
# Install Go
85+
ENV GOENV_ROOT="/.goenv"
86+
ENV PATH="${GOENV_ROOT}/shims:${GOENV_ROOT}/bin:/go/bin:$PATH"
87+
88+
COPY --from=scripts setup-go-compiler.sh /tmp
89+
RUN <<EOF
90+
setup_script="/tmp/setup-go-compiler.sh"
91+
${setup_script}
92+
EOF
93+
94+
RUN rm -rf /tmp/*

tests/ci/docker_images/linux-x86/ubuntu-24.04_android/build.gradle renamed to .github/docker_images/aws-lc/android/build.gradle

File renamed without changes.

tests/ci/docker_images/linux-x86/ubuntu-24.04_android/gradle.properties renamed to .github/docker_images/aws-lc/android/gradle.properties

File renamed without changes.

tests/ci/docker_images/linux-x86/ubuntu-24.04_android/gradle/wrapper/gradle-wrapper.jar renamed to .github/docker_images/aws-lc/android/gradle/wrapper/gradle-wrapper.jar

File renamed without changes.

tests/ci/docker_images/linux-x86/ubuntu-24.04_android/gradle/wrapper/gradle-wrapper.properties renamed to .github/docker_images/aws-lc/android/gradle/wrapper/gradle-wrapper.properties

File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)