diff --git a/.github/mergify.yml b/.github/mergify.yml index 91cd8881237..38f025c7814 100644 --- a/.github/mergify.yml +++ b/.github/mergify.yml @@ -32,6 +32,17 @@ pull_request_rules: - base=master actions: queue: + name: default + + # Adds the Pr to the batch queue, so that we can run the interop tests. See the `external_prs` queue for more info. + - name: Add to batch merge queue + conditions: + # All branch protection rules are implicit: https://docs.mergify.com/conditions/#about-branch-protection + - label=send-it-batch + - base=master + actions: + queue: + name: external_prs - name: Add approved dependabot PRs to merge queue conditions: @@ -40,6 +51,7 @@ pull_request_rules: - base=master actions: queue: + name: default - name: Remove reviews on updates after PR is queued for merging conditions: @@ -74,3 +86,8 @@ pull_request_rules: queue_rules: - name: default conditions: [] + # External PR's don't have access to secrets and variables, therefore they don't run the interop tests. + # using a batch queue allows to circumvent that as mergify creates it from an internal branch. + - name: external_prs + conditions: [] + batch_size: 1 diff --git a/.github/workflows/interop-test.yml b/.github/workflows/interop-test.yml index e9446d013d7..c88579be68a 100644 --- a/.github/workflows/interop-test.yml +++ b/.github/workflows/interop-test.yml @@ -28,6 +28,7 @@ jobs: AWS_BUCKET_NAME: ${{ vars.S3_LIBP2P_BUILD_CACHE_BUCKET_NAME }} AWS_ACCESS_KEY_ID: ${{ vars.S3_LIBP2P_BUILD_CACHE_AWS_ACCESS_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ secrets.S3_LIBP2P_BUILD_CACHE_AWS_SECRET_ACCESS_KEY }} + AWS_REGION: ${{ vars.S3_LIBP2P_BUILD_CACHE_AWS_REGION }} FLAVOUR: ${{ matrix.flavour }} - name: Run ${{ matrix.flavour }} tests @@ -38,6 +39,7 @@ jobs: s3-cache-bucket: ${{ vars.S3_LIBP2P_BUILD_CACHE_BUCKET_NAME }} s3-access-key-id: ${{ vars.S3_LIBP2P_BUILD_CACHE_AWS_ACCESS_KEY_ID }} s3-secret-access-key: ${{ secrets.S3_LIBP2P_BUILD_CACHE_AWS_SECRET_ACCESS_KEY }} + aws-region: ${{ vars.S3_LIBP2P_BUILD_CACHE_AWS_REGION }} worker-count: 16 run-holepunching-interop: name: Run hole-punch interoperability tests @@ -56,4 +58,5 @@ jobs: s3-cache-bucket: ${{ vars.S3_LIBP2P_BUILD_CACHE_BUCKET_NAME }} s3-access-key-id: ${{ vars.S3_LIBP2P_BUILD_CACHE_AWS_ACCESS_KEY_ID }} s3-secret-access-key: ${{ secrets.S3_LIBP2P_BUILD_CACHE_AWS_SECRET_ACCESS_KEY }} + aws-region: ${{ vars.S3_LIBP2P_BUILD_CACHE_AWS_REGION }} worker-count: 16 diff --git a/scripts/build-interop-image.sh b/scripts/build-interop-image.sh index 4b96e353f9a..ff6f344976c 100755 --- a/scripts/build-interop-image.sh +++ b/scripts/build-interop-image.sh @@ -6,13 +6,13 @@ CACHE_TO="" # If we have credentials, write to cache if [[ -n "${AWS_SECRET_ACCESS_KEY}" ]]; then - CACHE_TO="--cache-to type=s3,mode=max,bucket=${AWS_BUCKET_NAME},region=ap-southeast-2,prefix=buildCache,name=${FLAVOUR}-rust-libp2p-head" + CACHE_TO="--cache-to type=s3,mode=max,bucket=${AWS_BUCKET_NAME},region=${AWS_REGION},prefix=buildCache,name=${FLAVOUR}-rust-libp2p-head" fi docker buildx build \ --load \ $CACHE_TO \ - --cache-from type=s3,mode=max,bucket=${AWS_BUCKET_NAME},region=ap-southeast-2,prefix=buildCache,name=${FLAVOUR}-rust-libp2p-head \ + --cache-from type=s3,mode=max,bucket=${AWS_BUCKET_NAME},region=${AWS_REGION},prefix=buildCache,name=${FLAVOUR}-rust-libp2p-head \ -t ${FLAVOUR}-rust-libp2p-head \ . \ -f interop-tests/Dockerfile.${FLAVOUR}