Skip to content

Commit

Permalink
Merge branch 'main' into descriptor-pool-tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
adrian-cojocaru authored Nov 11, 2024
2 parents 68fab97 + 6b12d58 commit 0dc5029
Show file tree
Hide file tree
Showing 22 changed files with 731 additions and 308 deletions.
139 changes: 0 additions & 139 deletions .github/actions/aws-device-farm-run/action.yml

This file was deleted.

62 changes: 27 additions & 35 deletions .github/workflows/android-device-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,10 @@ jobs:
steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'

- id: parent_workflow
run: |
conclusion=$(curl ${{ github.event.workflow_run.jobs_url }} | jq -r '.jobs[] | select(.name == "android-build").conclusion')
Expand Down Expand Up @@ -130,53 +134,41 @@ jobs:
aws-region: us-west-2
role-to-assume: ${{ vars.OIDC_AWS_ROLE_TO_ASSUME }}
role-session-name: ${{ github.run_id }}

- name: Upload external data
if: env.run_device_test == 'true'

- name: Run ${{ matrix.test.name }} on AWS Device Farm
run: |
export RESULTS_API=${{ secrets.MLN_RESULTS_API }}
export AWS_DEVICE_FARM_PROJECT_ARN=${{ vars.AWS_DEVICE_FARM_PROJECT_ARN }}
upload_arn="$(.github/workflows/android-device-test/upload-external-data.sh)"
echo external_data_arn="$upload_arn" >> "$GITHUB_ENV"
- uses: ./.github/actions/aws-device-farm-run
id: aws_device_farm_run
if: env.run_device_test == 'true'
with:
name: ${{ matrix.test.name }}
appType: ANDROID_APP
appFile: ${{ matrix.test.appFile }}
testFile: ${{ matrix.test.testFile }}
testPackageType: INSTRUMENTATION_TEST_PACKAGE
testType: INSTRUMENTATION
testFilter: ${{ matrix.test.testFilter }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_ROLE_TO_ASSUME: ${{ vars.OIDC_AWS_ROLE_TO_ASSUME }}
AWS_DEVICE_FARM_PROJECT_ARN: ${{ vars.AWS_DEVICE_FARM_PROJECT_ARN }}
AWS_DEVICE_FARM_DEVICE_POOL_ARN: ${{ matrix.test.devicePool }}
externalData: ${{ env.external_data_arn }}
testSpecArn: ${{ matrix.test.testSpecArn }}
export name="${{ matrix.test.name }}"
export appType=ANDROID_APP
export appFile="${{ matrix.test.appFile }}"
export testFile="${{ matrix.test.testFile }}"
export testPackageType=INSTRUMENTATION_TEST_PACKAGE
export testType=INSTRUMENTATION
export testFilter="${{ matrix.test.testFilter }}"
export AWS_ACCESS_KEY_ID="${{ secrets.AWS_ACCESS_KEY_ID }}"
export AWS_SECRET_ACCESS_KEY="${{ secrets.AWS_SECRET_ACCESS_KEY }}"
export AWS_ROLE_TO_ASSUME="${{ vars.OIDC_AWS_ROLE_TO_ASSUME }}"
export AWS_DEVICE_FARM_PROJECT_ARN="${{ vars.AWS_DEVICE_FARM_PROJECT_ARN }}"
export AWS_DEVICE_FARM_DEVICE_POOL_ARN="${{ matrix.test.devicePool }}"
export testSpecArn="${{ matrix.test.testSpecArn }}"
export wait_for_completion=true
echo run_arn="$(./scripts/aws-device-farm/aws-device-farm-run.sh)" > "$GITHUB_ENV"
- name: Store Test Artifacts
if: (matrix.test.name == 'Android Benchmark' || failure()) && env.run_device_test == 'true'
run: |
npm install
results_dir="$(mktemp -d)"
echo results_dir="$results_dir" >> "$GITHUB_ENV"
node scripts/aws-device-farm/store-test-artifacts.mjs --runArn ${{ steps.aws_device_farm_run.outputs.runArn }} --outputDir "$results_dir"
zip -r test_artifacts.zip ${{ env.results_dir }}
node scripts/aws-device-farm/store-test-artifacts.mjs --runArn ${{ env.run_arn }} --outputDir "$results_dir"
zip -r test_artifacts.zip "$results_dir"
- name: Store Benchmark Results
if: matrix.test.name == 'Android Benchmark' && env.run_device_test == 'true'
run: |
for zipfile in ${{ env.results_dir }}/*.zip; do
unzip "$zipfile" -d "${zipfile%.zip}"
done
find "${{ env.results_dir }}" -name 'benchmark_results.json' | while read -r benchmark_json; do
aws s3 cp "$benchmark_json" "s3://maplibre-native/android-benchmark-render/$(uuidgen).json"
done
benchmark_results_dir="$(mktemp -d)"
node scripts/aws-device-farm/collect-benchmark-outputs.mjs --inputDir "${{ env.results_dir }}" --outputDir "$benchmark_results_dir"
node scripts/aws-device-farm/upload-benchmark-outputs-to-s3.mjs --dir "$benchmark_results_dir"
- name: Upload Test Artifacts
if: (matrix.test.name == 'Android Benchmark' || failure()) && env.run_device_test == 'true'
Expand Down
46 changes: 0 additions & 46 deletions .github/workflows/android-device-test/upload-external-data.sh

This file was deleted.

29 changes: 16 additions & 13 deletions .github/workflows/ios-device-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,20 +49,23 @@ jobs:
with:
files: "${{ matrix.test.xcTestFile }}, ${{ matrix.test.ipaFile }}"

- uses: ./.github/actions/aws-device-farm-run
- name: Run ${{ matrix.test.name }} on AWS Device Farm
if: steps.check_files.outputs.files_exists == 'true'
with:
name: ${{ matrix.test.name }}
appType: IOS_APP
appFile: ${{ matrix.test.ipaFile }}
testFile: ${{ matrix.test.xcTestFile }}
testPackageType: XCTEST_TEST_PACKAGE
testType: XCTEST
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_ROLE_TO_ASSUME: ${{ vars.OIDC_AWS_ROLE_TO_ASSUME }}
AWS_DEVICE_FARM_PROJECT_ARN: ${{ vars.AWS_DEVICE_FARM_PROJECT_ARN }}
AWS_DEVICE_FARM_DEVICE_POOL_ARN: ${{ vars.AWS_DEVICE_FARM_IPHONE_DEVICE_POOL_ARN }}
run: |
export name="${{ matrix.test.name }}"
export appType=IOS_APP
export appFile="${{ matrix.test.ipaFile }}"
export testFile="${{ matrix.test.xcTestFile }}"
export testPackageType=XCTEST_TEST_PACKAGE
export testType=XCTEST
export AWS_ACCESS_KEY_ID="${{ secrets.AWS_ACCESS_KEY_ID }}"
export AWS_SECRET_ACCESS_KEY="${{ secrets.AWS_SECRET_ACCESS_KEY }}"
export AWS_ROLE_TO_ASSUME="${{ vars.OIDC_AWS_ROLE_TO_ASSUME }}"
export AWS_DEVICE_FARM_PROJECT_ARN="${{ vars.AWS_DEVICE_FARM_PROJECT_ARN }}"
export AWS_DEVICE_FARM_DEVICE_POOL_ARN="${{ vars.AWS_DEVICE_FARM_IPHONE_DEVICE_POOL_ARN }}"
export wait_for_completion=true
./scripts/aws-device-farm/aws-device-farm-run.sh
- uses: LouisBrunner/[email protected]
if: always()
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
20.14.0
23
10 changes: 5 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"@octokit/rest": "^20.1.0",
"@types/argparse": "^2.0.16",
"@types/ejs": "^3.1.5",
"@types/node": "^20.16.1",
"@types/node": "^22.9.0",
"argparse": "^2.0.1",
"csscolorparser": "^1.0.3",
"d3-queue": "3.0.7",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1546,7 +1546,7 @@ public CameraPosition getCameraForLatLngBounds(@NonNull LatLngBounds latLngBound
* Get a camera position that fits a provided bounds and padding and the current camera tilt and bearing.
*
* @param latLngBounds the bounds to set the map with
* @param padding the padding to apply to the bounds
* @param padding the padding to apply to the bounds (in left, top, right, bottom order)
* @return the camera position that fits the bounds and padding
*/
@Nullable
Expand Down Expand Up @@ -1579,7 +1579,7 @@ public CameraPosition getCameraForLatLngBounds(@NonNull LatLngBounds latLngBound
* Get a camera position that fits a provided bounds, padding, bearing and tilt.
*
* @param latLngBounds the bounds to set the map with
* @param padding the padding to apply to the bounds
* @param padding the padding to apply to the bounds (in left, top, right, bottom order)
* @param bearing the bearing to transform the camera position with
* @param tilt to transform the camera position with
* @return the camera position that fits the bounds, bearing and tilt
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ void easeTo(@NonNull LatLng center, double zoom, double bearing, double pitch, d
@NonNull
CameraPosition getCameraPosition();

// Note for implementors: the ordering of the padding is left, top, right, bottom
CameraPosition getCameraForLatLngBounds(@NonNull LatLngBounds bounds, int[] padding, double bearing, double pitch);

CameraPosition getCameraForGeometry(@NonNull Geometry geometry, int[] padding, double bearing, double pitch);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,8 @@ public CameraPosition getCameraForLatLngBounds(
if (checkState("getCameraForLatLngBounds")) {
return null;
}
// Note that we have to juggle things a bit to match the ordering of arguments
// to match the NativeMapView C++ interface.
return nativeGetCameraForLatLngBounds(
bounds,
padding[1] / pixelRatio,
Expand Down
Loading

0 comments on commit 0dc5029

Please sign in to comment.