Skip to content

Commit 059742f

Browse files
jxsguillaumemichel
andauthored
chore(ci): add a mergify batch queue for external PRs (#5668)
and remove the if conditions no longer required as we are running them again on every PR --------- Co-authored-by: Guillaume Michel <[email protected]> Co-authored-by: João Oliveira <jxs>
1 parent 0e9dcdd commit 059742f

File tree

3 files changed

+22
-2
lines changed

3 files changed

+22
-2
lines changed

.github/mergify.yml

+17
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,17 @@ pull_request_rules:
3232
- base=master
3333
actions:
3434
queue:
35+
name: default
36+
37+
# Adds the Pr to the batch queue, so that we can run the interop tests. See the `external_prs` queue for more info.
38+
- name: Add to batch merge queue
39+
conditions:
40+
# All branch protection rules are implicit: https://docs.mergify.com/conditions/#about-branch-protection
41+
- label=send-it-batch
42+
- base=master
43+
actions:
44+
queue:
45+
name: external_prs
3546

3647
- name: Add approved dependabot PRs to merge queue
3748
conditions:
@@ -40,6 +51,7 @@ pull_request_rules:
4051
- base=master
4152
actions:
4253
queue:
54+
name: default
4355

4456
- name: Remove reviews on updates after PR is queued for merging
4557
conditions:
@@ -74,3 +86,8 @@ pull_request_rules:
7486
queue_rules:
7587
- name: default
7688
conditions: []
89+
# External PR's don't have access to secrets and variables, therefore they don't run the interop tests.
90+
# using a batch queue allows to circumvent that as mergify creates it from an internal branch.
91+
- name: external_prs
92+
conditions: []
93+
batch_size: 1

.github/workflows/interop-test.yml

+3
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ jobs:
2828
AWS_BUCKET_NAME: ${{ vars.S3_LIBP2P_BUILD_CACHE_BUCKET_NAME }}
2929
AWS_ACCESS_KEY_ID: ${{ vars.S3_LIBP2P_BUILD_CACHE_AWS_ACCESS_KEY_ID }}
3030
AWS_SECRET_ACCESS_KEY: ${{ secrets.S3_LIBP2P_BUILD_CACHE_AWS_SECRET_ACCESS_KEY }}
31+
AWS_REGION: ${{ vars.S3_LIBP2P_BUILD_CACHE_AWS_REGION }}
3132
FLAVOUR: ${{ matrix.flavour }}
3233

3334
- name: Run ${{ matrix.flavour }} tests
@@ -38,6 +39,7 @@ jobs:
3839
s3-cache-bucket: ${{ vars.S3_LIBP2P_BUILD_CACHE_BUCKET_NAME }}
3940
s3-access-key-id: ${{ vars.S3_LIBP2P_BUILD_CACHE_AWS_ACCESS_KEY_ID }}
4041
s3-secret-access-key: ${{ secrets.S3_LIBP2P_BUILD_CACHE_AWS_SECRET_ACCESS_KEY }}
42+
aws-region: ${{ vars.S3_LIBP2P_BUILD_CACHE_AWS_REGION }}
4143
worker-count: 16
4244
run-holepunching-interop:
4345
name: Run hole-punch interoperability tests
@@ -56,4 +58,5 @@ jobs:
5658
s3-cache-bucket: ${{ vars.S3_LIBP2P_BUILD_CACHE_BUCKET_NAME }}
5759
s3-access-key-id: ${{ vars.S3_LIBP2P_BUILD_CACHE_AWS_ACCESS_KEY_ID }}
5860
s3-secret-access-key: ${{ secrets.S3_LIBP2P_BUILD_CACHE_AWS_SECRET_ACCESS_KEY }}
61+
aws-region: ${{ vars.S3_LIBP2P_BUILD_CACHE_AWS_REGION }}
5962
worker-count: 16

scripts/build-interop-image.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ CACHE_TO=""
66

77
# If we have credentials, write to cache
88
if [[ -n "${AWS_SECRET_ACCESS_KEY}" ]]; then
9-
CACHE_TO="--cache-to type=s3,mode=max,bucket=${AWS_BUCKET_NAME},region=ap-southeast-2,prefix=buildCache,name=${FLAVOUR}-rust-libp2p-head"
9+
CACHE_TO="--cache-to type=s3,mode=max,bucket=${AWS_BUCKET_NAME},region=${AWS_REGION},prefix=buildCache,name=${FLAVOUR}-rust-libp2p-head"
1010
fi
1111

1212
docker buildx build \
1313
--load \
1414
$CACHE_TO \
15-
--cache-from type=s3,mode=max,bucket=${AWS_BUCKET_NAME},region=ap-southeast-2,prefix=buildCache,name=${FLAVOUR}-rust-libp2p-head \
15+
--cache-from type=s3,mode=max,bucket=${AWS_BUCKET_NAME},region=${AWS_REGION},prefix=buildCache,name=${FLAVOUR}-rust-libp2p-head \
1616
-t ${FLAVOUR}-rust-libp2p-head \
1717
. \
1818
-f interop-tests/Dockerfile.${FLAVOUR}

0 commit comments

Comments
 (0)