CI: Fast multidimensional Interop tests (#1991)

* Test interop on changes

* Add pull request event

* Nits

* Rm un-needed default

* Use build tag

* Point to master for interop-test

* Point to master for interop-test

* Go mod tidy
This commit is contained in:
Marco Munizaga
2023-01-13 13:50:44 -08:00
committed by GitHub
parent a4e16efbbe
commit 638329ddb6
10 changed files with 1203 additions and 66 deletions
+32 -19
View File
@@ -1,23 +1,36 @@
on: [push, pull_request]
name: Interoperability Testing
on:
pull_request:
push:
branches:
- "master"
jobs:
# NOTE: during a pull request run, github creates a merge commit referenced in `github.sha`
# that merge commit is not a regular commit. You won't find it with a regular `git checkout SHA` and
# tools like `go get repo@SHA` won't find it.
#
# As a workaround, we generate a path to the actual pull request's commit, it looks like:
# `github.com/external-org/go-libp2p@latest-commit-on-their-branch`
run-ping-interop-cross-version:
uses: "libp2p/test-plans/.github/workflows/run-composition.yml@master"
build-ping-container:
name: Build Ping interop container
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Build image
working-directory: ./test-plans
run: make
- name: Upload ping versions info
uses: actions/upload-artifact@v3
with:
name: ping-versions
path: ./test-plans/ping-versions.json
- name: Upload image tar
uses: actions/upload-artifact@v3
with:
name: ping-image
path: ./test-plans/ping-image.tar
run-multidim-interop:
needs: build-ping-container
uses: "libp2p/test-plans/.github/workflows/run-testplans.yml@master"
with:
composition_file: "ping/_compositions/go-cross-versions.toml"
custom_git_target: github.com/${{ github.event.pull_request.head.repo.full_name || github.event.repository.full_name }}
custom_git_reference: ${{ github.event.pull_request.head.sha || github.sha }}
run-ping-interop-cross-implementation:
uses: "libp2p/test-plans/.github/workflows/run-composition.yml@master"
with:
composition_file: "ping/_compositions/all-interop-latest.toml"
custom_git_target: github.com/${{ github.event.pull_request.head.repo.full_name || github.event.repository.full_name }}
custom_git_reference: ${{ github.event.pull_request.head.sha || github.sha }}
custom_interop_target: go
dir: "multidim-interop"
extra-versions: ping-versions
image-tar: ping-image
test-filter: "go-libp2p-head"
-47
View File
@@ -1,47 +0,0 @@
on:
pull_request:
branches:
- master
push:
branches:
- master
name: Interop Tests
jobs:
unit:
runs-on: ubuntu-latest
name: Js/Go
steps:
- uses: actions/setup-go@v2
with:
go-version: "1.16.x"
- name: Go information
run: |
go version
go env
- uses: actions/checkout@v2
with:
path: 'libp2p'
- uses: actions/checkout@v2
with:
repository: 'libp2p/go-libp2p-daemon'
path: 'daemon'
- uses: actions/checkout@v2
with:
repository: 'libp2p/interop'
path: 'interop'
- name: Mod replace go-libp2p in go-libp2p-daemon
working-directory: daemon
run: |
go mod edit -replace "github.com/libp2p/go-libp2p=../libp2p"
go mod tidy
- name: Build libp2p daemon
working-directory: daemon
run: |
go build -o daemon ./p2pd
- name: Setup interop tests
working-directory: interop
run: npm install
- name: Run interop tests
working-directory: interop
run: LIBP2P_GO_BIN="$(pwd)/../daemon/daemon" npm run test