From 6854351fb5c72adf596032c783f2533e3a018af8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20Frosteg=C3=A5rd?= Date: Sun, 9 Oct 2022 22:36:12 +0200 Subject: [PATCH] Move GitHub workflows into single file, split build-and-test --- .../Dockerfile | 0 .../action.yml | 4 +- .../entrypoint.sh | 0 .../{cargo-build-and-test.yml => ci.yml} | 41 ++++++++++++++++--- .github/workflows/test-transfer.yml | 22 ---------- README.md | 2 +- 6 files changed, 38 insertions(+), 31 deletions(-) rename .github/actions/{test-transfer => test-file-transfers}/Dockerfile (100%) rename .github/actions/{test-transfer => test-file-transfers}/action.yml (81%) rename .github/actions/{test-transfer => test-file-transfers}/entrypoint.sh (100%) rename .github/workflows/{cargo-build-and-test.yml => ci.yml} (57%) delete mode 100644 .github/workflows/test-transfer.yml diff --git a/.github/actions/test-transfer/Dockerfile b/.github/actions/test-file-transfers/Dockerfile similarity index 100% rename from .github/actions/test-transfer/Dockerfile rename to .github/actions/test-file-transfers/Dockerfile diff --git a/.github/actions/test-transfer/action.yml b/.github/actions/test-file-transfers/action.yml similarity index 81% rename from .github/actions/test-transfer/action.yml rename to .github/actions/test-file-transfers/action.yml index c04e4e8..67c1026 100644 --- a/.github/actions/test-transfer/action.yml +++ b/.github/actions/test-file-transfers/action.yml @@ -1,5 +1,5 @@ -name: 'test-transfer' -description: 'test aquatic file transfer' +name: 'test-file-transfers' +description: 'test aquatic file transfers' outputs: # http_ipv4: # description: 'HTTP IPv4 status' diff --git a/.github/actions/test-transfer/entrypoint.sh b/.github/actions/test-file-transfers/entrypoint.sh similarity index 100% rename from .github/actions/test-transfer/entrypoint.sh rename to .github/actions/test-file-transfers/entrypoint.sh diff --git a/.github/workflows/cargo-build-and-test.yml b/.github/workflows/ci.yml similarity index 57% rename from .github/workflows/cargo-build-and-test.yml rename to .github/workflows/ci.yml index 658625b..853f4b0 100644 --- a/.github/workflows/cargo-build-and-test.yml +++ b/.github/workflows/ci.yml @@ -1,4 +1,4 @@ -name: 'cargo: build and test' +name: CI on: push: @@ -10,9 +10,9 @@ env: CARGO_TERM_COLOR: always jobs: - build-test-linux: + build-linux: runs-on: ubuntu-latest - timeout-minutes: 25 + timeout-minutes: 20 steps: - uses: actions/checkout@v3 - name: Install latest stable Rust @@ -30,9 +30,6 @@ jobs: cargo build --verbose -p aquatic_udp --features "cpu-pinning" cargo build --verbose -p aquatic_http cargo build --verbose -p aquatic_ws - - name: Run tests - run: cargo test --verbose --workspace --profile "test-fast" - build-macos: runs-on: macos-latest @@ -49,3 +46,35 @@ jobs: uses: Swatinem/rust-cache@v2 - name: Build run: cargo build --verbose -p aquatic_udp + + test: + runs-on: ubuntu-latest + timeout-minutes: 10 + steps: + - uses: actions/checkout@v3 + - name: Install latest stable Rust + uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable + override: true + - name: Install dependencies + run: sudo apt-get update -y && sudo apt-get install libhwloc-dev -y + - name: Setup Rust dependency caching + uses: Swatinem/rust-cache@v2 + - name: Run tests + run: cargo test --verbose --workspace --profile "test-fast" + + test-file-transfers: + runs-on: ubuntu-latest + name: "Test BitTorrent file transfers over UDP, TLS and WSS" + timeout-minutes: 20 + container: + image: rust:1-bullseye + options: --ulimit memlock=524288:524288 + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Test file transfers + uses: ./.github/actions/test-file-transfers + id: test_file_transfers diff --git a/.github/workflows/test-transfer.yml b/.github/workflows/test-transfer.yml deleted file mode 100644 index c1ae76b..0000000 --- a/.github/workflows/test-transfer.yml +++ /dev/null @@ -1,22 +0,0 @@ -name: "Test UDP, TLS and WSS file transfer" - -on: - push: - branches: [ master ] - pull_request: - branches: [ master ] - -jobs: - test-transfer-http: - runs-on: ubuntu-latest - name: "Test BitTorrent file transfer over UDP, TLS and WSS" - timeout-minutes: 20 - container: - image: rust:1-bullseye - options: --ulimit memlock=524288:524288 - steps: - - name: Checkout - uses: actions/checkout@v2 - - name: Test file transfers - uses: ./.github/actions/test-transfer - id: test_transfer diff --git a/README.md b/README.md index 2f9420a..2e867d6 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # aquatic: high-performance open BitTorrent tracker -[![CargoBuildAndTest](https://github.com/greatest-ape/aquatic/actions/workflows/cargo-build-and-test.yml/badge.svg)](https://github.com/greatest-ape/aquatic/actions/workflows/cargo-build-and-test.yml) [![Test HTTP, UDP and WSS file transfer](https://github.com/greatest-ape/aquatic/actions/workflows/test-transfer.yml/badge.svg)](https://github.com/greatest-ape/aquatic/actions/workflows/test-transfer.yml) +[![CI](https://github.com/greatest-ape/aquatic/actions/workflows/ci.yml/badge.svg)](https://github.com/greatest-ape/aquatic/actions/workflows/ci.yml) High-performance open BitTorrent tracker, consisting of sub-implementations for different protocols: