From 7fb23bb49030bd8f30d18ee51685bb01b9bc1148 Mon Sep 17 00:00:00 2001 From: Zoe Roux Date: Fri, 21 Feb 2025 22:44:11 +0100 Subject: [PATCH] Add ci to run bun test --- .github/workflows/api-test.yml | 47 ++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 .github/workflows/api-test.yml diff --git a/.github/workflows/api-test.yml b/.github/workflows/api-test.yml new file mode 100644 index 00000000..53d6ecab --- /dev/null +++ b/.github/workflows/api-test.yml @@ -0,0 +1,47 @@ +name: Tests +on: + push: + branches: + - master + - next + pull_request: + workflow_dispatch: + +jobs: + test: + name: Test api + runs-on: ubuntu-latest + services: + postgres: + image: postgres:15 + ports: + - "5432:5432" + env: + POSTGRES_USER: kyoo + POSTGRES_PASSWORD: password + options: >- + --health-cmd pg_isready + --health-interval 10s + --health-timeout 5s + --health-retries 5 + steps: + - uses: actions/checkout@v4 + - uses: oven-sh/setup-bun@v2 + + - name: Install dependencies + working-directory: ./api + run: bun install --frozen-lockfile + + - name: Test + working-directory: ./api + run: bun test + env: + JWT_SECRET: "TODO" + POSTGRES_SERVER: localhost + + - uses: actions/upload-artifact@v4 + with: + name: results + path: auth/out + +