From f2d165aa601d04f6f6c651f6e21bff4352787880 Mon Sep 17 00:00:00 2001 From: Tibo De Peuter Date: Wed, 2 Apr 2025 19:49:40 +0200 Subject: [PATCH] ci: Merge testing actions --- .github/workflows/testing.yml | 56 +++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 .github/workflows/testing.yml diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml new file mode 100644 index 00000000..78253d2b --- /dev/null +++ b/.github/workflows/testing.yml @@ -0,0 +1,56 @@ +name: Combined Testing + +on: + push: + branches: [ "dev" ] + pull_request: + branches: [ "dev" ] + types: ["synchronize", "ready_for_review", "opened", "reopened"] + +jobs: + backend-test: + name: Run backend unit tests + if: "! github.event.pull_request.draft" + runs-on: [self-hosted, Linux, X64] + strategy: + matrix: + node-version: [22.x] + steps: + - uses: actions/checkout@v4 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node-version }} + cache: 'npm' + - run: npm ci + - run: npm run test:unit -w backend + paths: + - 'backend/src/**.[jt]s' + - 'backend/tests/**.[jt]s' + - 'backend/vitest.config.ts' + + frontend-test: + name: Run frontend unit tests + if: "! github.event.pull_request.draft" + runs-on: [self-hosted, Linux, X64] + strategy: + matrix: + node-version: [22.x] + steps: + - uses: actions/checkout@v4 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node-version }} + cache: 'npm' + - run: npm ci + - run: npm run test:unit -w frontend + paths: + - 'frontend/src/**.[jt]s' + - 'frontend/src/**.vue' + - 'frontend/src/**.css' + - 'frontend/tests/**.[jt]s' + - 'frontend/tests/**.vue' + - 'frontend/tests/**.css' + - 'frontend/vitest.config.ts' + - 'frontend/playwright.config.ts'