From 1807901a02ff0cd32b3d4037b719cac82081c9b5 Mon Sep 17 00:00:00 2001 From: MarcusGrass Date: Sun, 28 Sep 2025 12:44:39 +0200 Subject: [PATCH 1/5] feat: add test runner to ci, make test runner fail on errors --- .github/workflows/main.yml | 7 +++++++ p2proxy-test-runner/src/main.rs | 3 ++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b609a48..6ee549d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -31,6 +31,13 @@ jobs: - uses: dtolnay/rust-toolchain@stable - run: cargo test --all-features + integration-test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v5 + - uses: dtolnay/rust-toolchain@stable + - run: cargo r -p p2proxy-test-runner + deny: runs-on: ubuntu-latest steps: diff --git a/p2proxy-test-runner/src/main.rs b/p2proxy-test-runner/src/main.rs index e732869..c2c9291 100644 --- a/p2proxy-test-runner/src/main.rs +++ b/p2proxy-test-runner/src/main.rs @@ -23,6 +23,7 @@ async fn main() -> anyhow::Result<()> { eprintln!("server at 4503:"); test_server_4503.dump_output().await; } - + simple_res?; + extensive_res?; Ok(()) } From f94ef6b73b4db5184a11f6b0576bbf1d80289e6d Mon Sep 17 00:00:00 2001 From: MarcusGrass Date: Sun, 28 Sep 2025 12:47:54 +0200 Subject: [PATCH 2/5] fix: install libglib2.0-dev on ci runner --- .github/workflows/main.yml | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 6ee549d..3bbac0e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -22,21 +22,30 @@ jobs: - uses: dtolnay/rust-toolchain@stable with: components: clippy - - run: cargo clippy --all-targets --all-features -- -D warnings + - run: | + sudo apt-get update + sudo apt-get install libglib2.0-dev libgtk-3-dev + cargo clippy --all-targets --all-features -- -D warnings cargo-test: runs-on: ubuntu-latest steps: - uses: actions/checkout@v5 - uses: dtolnay/rust-toolchain@stable - - run: cargo test --all-features + - run: | + sudo apt-get update + sudo apt-get install libglib2.0-dev libgtk-3-dev + cargo test --all-features integration-test: runs-on: ubuntu-latest steps: - uses: actions/checkout@v5 - uses: dtolnay/rust-toolchain@stable - - run: cargo r -p p2proxy-test-runner + - run: | + sudo apt-get update + sudo apt-get install libglib2.0-dev libgtk-3-dev + cargo r -p p2proxy-test-runner deny: runs-on: ubuntu-latest From 44d49410c4b87f6927e90167c38a80df4c94afcc Mon Sep 17 00:00:00 2001 From: MarcusGrass Date: Sun, 28 Sep 2025 13:20:29 +0200 Subject: [PATCH 3/5] fix: set names for steps, remove integration testing from github ci --- .github/workflows/main.yml | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 3bbac0e..2767c1b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -13,7 +13,8 @@ jobs: - uses: dtolnay/rust-toolchain@stable with: components: rustfmt - - run: cargo fmt --all --check + - name: rustfmt + run: cargo fmt --all --check lint: runs-on: ubuntu-latest @@ -22,7 +23,8 @@ jobs: - uses: dtolnay/rust-toolchain@stable with: components: clippy - - run: | + - name: clippy + run: | sudo apt-get update sudo apt-get install libglib2.0-dev libgtk-3-dev cargo clippy --all-targets --all-features -- -D warnings @@ -32,21 +34,12 @@ jobs: steps: - uses: actions/checkout@v5 - uses: dtolnay/rust-toolchain@stable - - run: | + - name: cargo test + run: | sudo apt-get update sudo apt-get install libglib2.0-dev libgtk-3-dev cargo test --all-features - integration-test: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v5 - - uses: dtolnay/rust-toolchain@stable - - run: | - sudo apt-get update - sudo apt-get install libglib2.0-dev libgtk-3-dev - cargo r -p p2proxy-test-runner - deny: runs-on: ubuntu-latest steps: @@ -55,4 +48,5 @@ jobs: - uses: taiki-e/install-action@v2 with: tool: cargo-deny - - run: cargo deny check + - name: cargo deny + run: cargo deny check From d58c1f9a47aead869704180d091e45a3aef3f68f Mon Sep 17 00:00:00 2001 From: MarcusGrass Date: Sun, 28 Sep 2025 13:22:55 +0200 Subject: [PATCH 4/5] fix: reorder ci steps for fewer rebuilds --- assets/testing/ci.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets/testing/ci.sh b/assets/testing/ci.sh index a3ca00e..58fc884 100755 --- a/assets/testing/ci.sh +++ b/assets/testing/ci.sh @@ -2,7 +2,7 @@ set -e cargo fmt --all --check cargo clippy --all-targets --all-features -- -D warnings -cargo test --all-features cargo r -p p2proxy-test-runner +cargo test --all-features cargo deny check gitleaks --verbose detect \ No newline at end of file From a0595c9bae6eb88777c0166c47eeaeb6f59e7323 Mon Sep 17 00:00:00 2001 From: MarcusGrass Date: Sun, 28 Sep 2025 13:27:45 +0200 Subject: [PATCH 5/5] fix: cancel in progress ci on further pushes --- .github/workflows/main.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 2767c1b..7ccbaeb 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -5,6 +5,10 @@ on: - main pull_request: { } +concurrency: + group: ${{ github.head_ref }} + cancel-in-progress: true + jobs: format: runs-on: ubuntu-latest