Skip to content

Commit 6802a0e

Browse files
update interop test run condition
1 parent f3e0e55 commit 6802a0e

File tree

1 file changed

+50
-47
lines changed

1 file changed

+50
-47
lines changed

.github/workflows/interop-test.yml

Lines changed: 50 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,59 @@
11
name: Interoperability Testing
22
on:
3-
push:
4-
branches:
5-
- "master"
3+
pull_request:
4+
push:
5+
branches:
6+
- "master"
67

78
concurrency:
8-
group: ${{ github.workflow }}-${{ github.ref }}
9-
cancel-in-progress: true
9+
group: ${{ github.workflow }}-${{ github.ref }}
10+
cancel-in-progress: true
1011

1112
jobs:
12-
run-transport-interop:
13-
name: Run transport interoperability tests
14-
runs-on: ${{ fromJSON(github.repository == 'libp2p/rust-libp2p' && '["self-hosted", "linux", "x64", "4xlarge"]' || '"ubuntu-latest"') }}
15-
strategy:
16-
matrix:
17-
flavour: [chromium, native]
18-
steps:
19-
- uses: actions/checkout@v4
13+
run-transport-interop:
14+
name: Run transport interoperability tests
15+
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository
16+
runs-on: ${{ fromJSON(github.repository == 'libp2p/rust-libp2p' && '["self-hosted", "linux", "x64", "4xlarge"]' || '"ubuntu-latest"') }}
17+
strategy:
18+
matrix:
19+
flavour: [chromium, native]
20+
steps:
21+
- uses: actions/checkout@v4
2022

21-
- uses: docker/setup-buildx-action@v3
23+
- uses: docker/setup-buildx-action@v3
2224

23-
- name: Build ${{ matrix.flavour }} image
24-
run: ./scripts/build-interop-image.sh
25-
env:
26-
AWS_BUCKET_NAME: ${{ vars.S3_LIBP2P_BUILD_CACHE_BUCKET_NAME }}
27-
AWS_ACCESS_KEY_ID: ${{ vars.S3_LIBP2P_BUILD_CACHE_AWS_ACCESS_KEY_ID }}
28-
AWS_SECRET_ACCESS_KEY: ${{ secrets.S3_LIBP2P_BUILD_CACHE_AWS_SECRET_ACCESS_KEY }}
29-
FLAVOUR: ${{ matrix.flavour }}
25+
- name: Build ${{ matrix.flavour }} image
26+
run: ./scripts/build-interop-image.sh
27+
env:
28+
AWS_BUCKET_NAME: ${{ vars.S3_LIBP2P_BUILD_CACHE_BUCKET_NAME }}
29+
AWS_ACCESS_KEY_ID: ${{ vars.S3_LIBP2P_BUILD_CACHE_AWS_ACCESS_KEY_ID }}
30+
AWS_SECRET_ACCESS_KEY: ${{ secrets.S3_LIBP2P_BUILD_CACHE_AWS_SECRET_ACCESS_KEY }}
31+
FLAVOUR: ${{ matrix.flavour }}
3032

31-
- name: Run ${{ matrix.flavour }} tests
32-
uses: libp2p/test-plans/.github/actions/run-transport-interop-test@master
33-
with:
34-
test-filter: ${{ matrix.flavour }}-rust-libp2p-head
35-
extra-versions: ${{ github.workspace }}/interop-tests/${{ matrix.flavour }}-ping-version.json
36-
s3-cache-bucket: ${{ vars.S3_LIBP2P_BUILD_CACHE_BUCKET_NAME }}
37-
s3-access-key-id: ${{ vars.S3_LIBP2P_BUILD_CACHE_AWS_ACCESS_KEY_ID }}
38-
s3-secret-access-key: ${{ secrets.S3_LIBP2P_BUILD_CACHE_AWS_SECRET_ACCESS_KEY }}
39-
worker-count: 16
40-
run-holepunching-interop:
41-
name: Run hole-punch interoperability tests
42-
runs-on: ${{ fromJSON(github.repository == 'libp2p/rust-libp2p' && '["self-hosted", "linux", "x64", "4xlarge"]' || '"ubuntu-latest"') }}
43-
steps:
44-
- uses: actions/checkout@v4
45-
- uses: docker/setup-buildx-action@v3
46-
- name: Build image
47-
run: docker buildx build --load -t rust-libp2p-head . -f hole-punching-tests/Dockerfile
48-
- name: Run tests
49-
uses: libp2p/test-plans/.github/actions/run-interop-hole-punch-test@master
50-
with:
51-
test-filter: rust-libp2p-head
52-
extra-versions: ${{ github.workspace }}/hole-punching-tests/version.json
53-
s3-cache-bucket: ${{ vars.S3_LIBP2P_BUILD_CACHE_BUCKET_NAME }}
54-
s3-access-key-id: ${{ vars.S3_LIBP2P_BUILD_CACHE_AWS_ACCESS_KEY_ID }}
55-
s3-secret-access-key: ${{ secrets.S3_LIBP2P_BUILD_CACHE_AWS_SECRET_ACCESS_KEY }}
56-
worker-count: 16
33+
- name: Run ${{ matrix.flavour }} tests
34+
uses: libp2p/test-plans/.github/actions/run-transport-interop-test@master
35+
with:
36+
test-filter: ${{ matrix.flavour }}-rust-libp2p-head
37+
extra-versions: ${{ github.workspace }}/interop-tests/${{ matrix.flavour }}-ping-version.json
38+
s3-cache-bucket: ${{ vars.S3_LIBP2P_BUILD_CACHE_BUCKET_NAME }}
39+
s3-access-key-id: ${{ vars.S3_LIBP2P_BUILD_CACHE_AWS_ACCESS_KEY_ID }}
40+
s3-secret-access-key: ${{ secrets.S3_LIBP2P_BUILD_CACHE_AWS_SECRET_ACCESS_KEY }}
41+
worker-count: 16
42+
run-holepunching-interop:
43+
name: Run hole-punch interoperability tests
44+
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository
45+
runs-on: ${{ fromJSON(github.repository == 'libp2p/rust-libp2p' && '["self-hosted", "linux", "x64", "4xlarge"]' || '"ubuntu-latest"') }}
46+
steps:
47+
- uses: actions/checkout@v4
48+
- uses: docker/setup-buildx-action@v3
49+
- name: Build image
50+
run: docker buildx build --load -t rust-libp2p-head . -f hole-punching-tests/Dockerfile
51+
- name: Run tests
52+
uses: libp2p/test-plans/.github/actions/run-interop-hole-punch-test@master
53+
with:
54+
test-filter: rust-libp2p-head
55+
extra-versions: ${{ github.workspace }}/hole-punching-tests/version.json
56+
s3-cache-bucket: ${{ vars.S3_LIBP2P_BUILD_CACHE_BUCKET_NAME }}
57+
s3-access-key-id: ${{ vars.S3_LIBP2P_BUILD_CACHE_AWS_ACCESS_KEY_ID }}
58+
s3-secret-access-key: ${{ secrets.S3_LIBP2P_BUILD_CACHE_AWS_SECRET_ACCESS_KEY }}
59+
worker-count: 16

0 commit comments

Comments
 (0)