From df4c3fa675c95b18dd437614a3c1dd717af89407 Mon Sep 17 00:00:00 2001 From: c43721 Date: Tue, 7 Oct 2025 19:36:21 -0500 Subject: [PATCH 1/2] chore: ci tests --- .github/workflows/test.yml | 43 ++++++++++++++++++++++++++++++++++++++ deno.json | 14 ++++++++++--- 2 files changed, 54 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..41b1269 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,43 @@ +name: Run Tests + +on: + push: + branches: + - main + pull_request: + branches: + - main + +permissions: + contents: read + pull-requests: write + +jobs: + test: + runs-on: ubuntu-latest + + services: + test-server: + image: ghcr.io/tf2pickup-org/tf2-gameserver:latest + ports: + - 27015:27015/tcp + - 27015:27015/udp + - 27020:27020/udp + env: + SERVER_HOSTNAME: 'test rcon server' + PORT: 27015 + CLIENT_PORT: 27016 + STEAM_PORT: 27017 + STV_PORT: 27020 + RCON_PASSWORD: '123456' + options: --tty --add-host host.docker.internal:host-gateway + + steps: + - uses: actions/checkout@v4 + + - uses: denoland/setup-deno@v2 + with: + cache: true + deno-version: v2.x + + - run: deno test diff --git a/deno.json b/deno.json index 4003238..8073062 100644 --- a/deno.json +++ b/deno.json @@ -1,9 +1,17 @@ { "name": "@c43721/rcon", "imports": { - "@std/bytes": "jsr:@std/bytes@^1.0.2", - "@std/cli": "jsr:@std/cli@^1.0.6", - "@std/async": "jsr:@std/async@^1.0.8" + "@std/bytes": "jsr:@std/bytes@^1.0.6", + "@std/cli": "jsr:@std/cli@^1.0.22", + "@std/async": "jsr:@std/async@^1.0.14" + }, + "test": { + "permissions": { + "write": true + } + }, + "fmt": { + "lineWidth": 240 }, "version": "0.0.7", "exports": "./mod.ts", From fad080691ca14a67b5ed2bbf6456dbee362ee4f9 Mon Sep 17 00:00:00 2001 From: c43721 Date: Tue, 7 Oct 2025 22:13:54 -0500 Subject: [PATCH 2/2] fix: fix tests --- .github/workflows/test.yml | 4 ++-- deno.json | 11 +++-------- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 41b1269..bc947f8 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -29,7 +29,7 @@ jobs: CLIENT_PORT: 27016 STEAM_PORT: 27017 STV_PORT: 27020 - RCON_PASSWORD: '123456' + RCON_PASSWORD: 'password' options: --tty --add-host host.docker.internal:host-gateway steps: @@ -40,4 +40,4 @@ jobs: cache: true deno-version: v2.x - - run: deno test + - run: deno task test diff --git a/deno.json b/deno.json index 8073062..202b56c 100644 --- a/deno.json +++ b/deno.json @@ -1,18 +1,13 @@ { "name": "@c43721/rcon", + "tasks": { + "test": "deno test -WN" + }, "imports": { "@std/bytes": "jsr:@std/bytes@^1.0.6", "@std/cli": "jsr:@std/cli@^1.0.22", "@std/async": "jsr:@std/async@^1.0.14" }, - "test": { - "permissions": { - "write": true - } - }, - "fmt": { - "lineWidth": 240 - }, "version": "0.0.7", "exports": "./mod.ts", "publish": {