Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: run test on self-hosted runners #3782

Merged
merged 19 commits into from
Apr 25, 2023
Merged
Show file tree
Hide file tree
Changes from 16 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 15 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,23 @@ env:
jobs:
test:
name: Test ${{ matrix.crate }}
runs-on: ubuntu-latest
runs-on: ${{ fromJSON(
github.repository == 'libp2p/rust-libp2p' && (
galargh marked this conversation as resolved.
Show resolved Hide resolved
(contains(fromJSON('["libp2p-webrtc", "libp2p"]'), matrix.crate) && '["self-hosted", "linux", "x64", "2xlarge"]') ||
(contains(fromJSON('["libp2p-quic", "libp2p-perf"]'), matrix.crate) && '["self-hosted", "linux", "x64", "xlarge"]') ||
'["self-hosted", "linux", "x64", "large"]'
galargh marked this conversation as resolved.
Show resolved Hide resolved
) || '"ubuntu-latest"') }}
timeout-minutes: 10
needs: gather_published_crates
strategy:
fail-fast: false
matrix:
crate: ${{ fromJSON(needs.gather_published_crates.outputs.members) }}
steps:
- name: Install Protoc
run: sudo apt-get install protobuf-compiler
run: sudo apt-get install -y protobuf-compiler

- uses: dtolnay/rust-toolchain@stable

- uses: actions/checkout@v3

Expand All @@ -33,6 +41,7 @@ jobs:
run: |
RUST_VERSION=$(cargo metadata --format-version=1 --no-deps | jq -r '.packages[] | select(.name == "${{ matrix.crate }}") | .rust_version')
echo "version=${RUST_VERSION}" >> $GITHUB_OUTPUT
shell: bash

- name: Install Rust ${{ steps.parse-msrv.outputs.version }} for MSRV check
uses: dtolnay/rust-toolchain@master
Expand All @@ -41,6 +50,8 @@ jobs:

- uses: r7kamura/rust-problem-matchers@d58b70c4a13c4866d96436315da451d8106f8f08 #v1.3.0

# consider using https://github.com/mozilla/sccache/blob/main/docs/S3.md
# and https://github.com/mozilla/sccache/blob/main/docs/GHA.md
galargh marked this conversation as resolved.
Show resolved Hide resolved
- uses: Swatinem/rust-cache@6fd3edff6979b79f87531400ad694fb7f2c84b1f # v2.2.1
with:
shared-key: msrv-cache
Expand All @@ -51,6 +62,8 @@ jobs:

- uses: dtolnay/rust-toolchain@stable

# consider using https://github.com/mozilla/sccache/blob/main/docs/S3.md
# and https://github.com/mozilla/sccache/blob/main/docs/GHA.md
galargh marked this conversation as resolved.
Show resolved Hide resolved
- uses: Swatinem/rust-cache@6fd3edff6979b79f87531400ad694fb7f2c84b1f # v2.2.1
with:
shared-key: stable-cache
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/interop-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,17 @@ concurrency:
jobs:
run-multidim-interop:
name: Run multidimensional interoperability tests
runs-on: ubuntu-22.04
runs-on: ${{ fromJSON(github.repository == 'libp2p/rust-libp2p' && '["self-hosted", "linux", "x64", "4xlarge"]' || '"ubuntu-latest"') }}
galargh marked this conversation as resolved.
Show resolved Hide resolved
steps:
- uses: actions/checkout@v3
- uses: docker/setup-buildx-action@v2
- name: Build image
run: docker buildx build --load -t rust-libp2p-head . -f interop-tests/Dockerfile
- uses: libp2p/test-plans/.github/actions/run-interop-ping-test@master
- uses: libp2p/test-plans/.github/actions/run-interop-ping-test@feat/self-hosted-runners
with:
test-filter: rust-libp2p-head
extra-versions: ${{ github.workspace }}/interop-tests/ping-version.json
s3-cache-bucket: libp2p-by-tf-aws-bootstrap
s3-access-key-id: ${{ vars.TEST_PLANS_BUILD_CACHE_KEY_ID }}
s3-secret-access-key: ${{ secrets.TEST_PLANS_BUILD_CACHE_KEY }}
worker-count: ${{ github.repository == 'libp2p/rust-libp2p' && 16 || 2 }}
galargh marked this conversation as resolved.
Show resolved Hide resolved