diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..bc947f8 --- /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: 'password' + 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 task test diff --git a/deno.json b/deno.json index 4003238..202b56c 100644 --- a/deno.json +++ b/deno.json @@ -1,9 +1,12 @@ { "name": "@c43721/rcon", + "tasks": { + "test": "deno test -WN" + }, "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" }, "version": "0.0.7", "exports": "./mod.ts",