From c67baf216c6c12e166b11a061b11ac99a23f52fd Mon Sep 17 00:00:00 2001 From: Timo De Meyst Date: Sun, 16 Mar 2025 17:15:09 +0100 Subject: [PATCH 01/11] actions: Testing workflow aangemaakt Op PRs naar dev die geen draft zijn worden automatisch testen uitgevoerd --- .github/workflows/testing.yml | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 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..4913f9fc --- /dev/null +++ b/.github/workflows/testing.yml @@ -0,0 +1,32 @@ +# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs + +name: Testing + +on: + push: + branches: [ "dev" ] + pull_request: + branches: [ "dev" ] + +jobs: + test: + name: Run unit tests + if: '! github.event.pull_request.draft' + runs-on: [self-hosted, Linux, X64] + + strategy: + matrix: + node-version: [22.x] + # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ + + 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 build --if-present + - run: npm run test:unit From fbf53c3d367388450731be2d2a13bed65eb02e67 Mon Sep 17 00:00:00 2001 From: Timo De Meyst Date: Sun, 16 Mar 2025 17:15:51 +0100 Subject: [PATCH 02/11] fix: update vite config config aangepast zodat project kan gebuild worden met top-level awaits --- frontend/vite.config.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/frontend/vite.config.ts b/frontend/vite.config.ts index 9ebf424b..845e025f 100644 --- a/frontend/vite.config.ts +++ b/frontend/vite.config.ts @@ -12,4 +12,7 @@ export default defineConfig({ "@": fileURLToPath(new URL("./src", import.meta.url)), }, }, + build: { + target: 'esnext' //browsers can handle the latest ES features + }, }); From 0cb1436772a4471465cc27196ffdf10d4dfb275c Mon Sep 17 00:00:00 2001 From: Timo De Meyst Date: Sun, 16 Mar 2025 17:21:23 +0100 Subject: [PATCH 03/11] actions: lint-action workflow update linters worden enkel uitgevoerd op PRs die geen draft zijn --- .github/workflows/lint-action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/lint-action.yml b/.github/workflows/lint-action.yml index b136a850..b8137275 100644 --- a/.github/workflows/lint-action.yml +++ b/.github/workflows/lint-action.yml @@ -11,7 +11,6 @@ on: pull_request: branches: - dev - types: [ready_for_review] # Down scope as necessary via https://docs.github.com/en/actions/security-guides/automatic-token-authentication#modifying-the-permissions-for-the-github_token @@ -22,6 +21,7 @@ permissions: jobs: run-linters: name: Run linters + if: '! github.event.pull_request.draft' runs-on: [self-hosted, Linux, X64] steps: From 27d5c5cbabda74e15988748f52850977defd86a6 Mon Sep 17 00:00:00 2001 From: Timo De Meyst Date: Tue, 18 Mar 2025 10:28:13 +0100 Subject: [PATCH 04/11] actions: workflows update workflows worden op PR uitgevoerd voor elke nodige mogelijke update van een PR --- .github/workflows/lint-action.yml | 1 + .github/workflows/testing.yml | 1 + 2 files changed, 2 insertions(+) diff --git a/.github/workflows/lint-action.yml b/.github/workflows/lint-action.yml index b8137275..c59191ed 100644 --- a/.github/workflows/lint-action.yml +++ b/.github/workflows/lint-action.yml @@ -11,6 +11,7 @@ on: pull_request: branches: - dev + types: ["synchronize", "ready_for_review", "opened", "reopened"] # Down scope as necessary via https://docs.github.com/en/actions/security-guides/automatic-token-authentication#modifying-the-permissions-for-the-github_token diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 4913f9fc..ce08509b 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -8,6 +8,7 @@ on: branches: [ "dev" ] pull_request: branches: [ "dev" ] + types: ["synchronize", "ready_for_review", "opened", "reopened"] jobs: test: From f4397255397635182ed1212fa868fd31af8a944d Mon Sep 17 00:00:00 2001 From: Lint Action Date: Tue, 18 Mar 2025 09:29:23 +0000 Subject: [PATCH 05/11] style: fix linting issues met ESLint --- frontend/vite.config.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/vite.config.ts b/frontend/vite.config.ts index 845e025f..2fad8e54 100644 --- a/frontend/vite.config.ts +++ b/frontend/vite.config.ts @@ -13,6 +13,6 @@ export default defineConfig({ }, }, build: { - target: 'esnext' //browsers can handle the latest ES features + target: 'esnext' //Browsers can handle the latest ES features }, }); From 641266f0fe7e893fe184f0acf05c6389c39b5c8a Mon Sep 17 00:00:00 2001 From: Lint Action Date: Tue, 18 Mar 2025 09:29:27 +0000 Subject: [PATCH 06/11] style: fix linting issues met Prettier --- frontend/vite.config.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/vite.config.ts b/frontend/vite.config.ts index 2fad8e54..8f5f992b 100644 --- a/frontend/vite.config.ts +++ b/frontend/vite.config.ts @@ -13,6 +13,6 @@ export default defineConfig({ }, }, build: { - target: 'esnext' //Browsers can handle the latest ES features - }, + target: "esnext", //Browsers can handle the latest ES features + }, }); From 08d45996640f38980179aec81c5129c65b545f47 Mon Sep 17 00:00:00 2001 From: Timo De Meyst Date: Tue, 18 Mar 2025 10:57:58 +0100 Subject: [PATCH 07/11] actions: update testing workflow npm run build is niet nodig om te testen --- .github/workflows/testing.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index ce08509b..20e7d221 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -29,5 +29,4 @@ jobs: node-version: ${{ matrix.node-version }} cache: 'npm' - run: npm ci - - run: npm run build --if-present - run: npm run test:unit From ec8efc554ea1b9ad5f71667c83c099c6c8c8fea2 Mon Sep 17 00:00:00 2001 From: Timo De Meyst Date: Tue, 18 Mar 2025 11:02:51 +0100 Subject: [PATCH 08/11] test: test:unit script update unit tests worden enkel uitgevoerd in de back- en frontend workspaces --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index db7f5ba3..b96114ae 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ "format-check": "npm run format-check --ws", "generate-docs": "python3 -m venv .venv && source .venv/bin/activate && pip install -r docs/requirements.txt && python docs/architecture/schema.py", "lint": "npm run lint --ws", - "test:unit": "npm run test:unit --ws" + "test:unit": "npm run test:unit -w backend -w frontend" }, "workspaces": [ "backend", From 66e58ef111cc6fa6d9caa2f6a285402e32bdb12c Mon Sep 17 00:00:00 2001 From: Timo De Meyst Date: Tue, 25 Mar 2025 22:13:53 +0100 Subject: [PATCH 09/11] actions: testing opgesplitst frontend en backend worden nu apart getest --- .github/workflows/backend-testing.yml | 33 ++++++++++++++++++++++++++ .github/workflows/frontend-testing.yml | 32 +++++++++++++++++++++++++ 2 files changed, 65 insertions(+) create mode 100644 .github/workflows/backend-testing.yml create mode 100644 .github/workflows/frontend-testing.yml diff --git a/.github/workflows/backend-testing.yml b/.github/workflows/backend-testing.yml new file mode 100644 index 00000000..caec6c07 --- /dev/null +++ b/.github/workflows/backend-testing.yml @@ -0,0 +1,33 @@ +# This workflow will do a clean installation of node dependencies, cache/restore them, run backend tests across different versions of node (here 22.x) +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs + +name: Backend Testing + +on: + push: + branches: [ "dev" ] + pull_request: + branches: [ "dev" ] + types: ["synchronize", "ready_for_review", "opened", "reopened"] + + +jobs: + test: + name: Run backend unit tests + if: '! github.event.pull_request.draft' + runs-on: [self-hosted, Linux, X64] + + strategy: + matrix: + node-version: [22.x] + # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ + + 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 diff --git a/.github/workflows/frontend-testing.yml b/.github/workflows/frontend-testing.yml new file mode 100644 index 00000000..825065be --- /dev/null +++ b/.github/workflows/frontend-testing.yml @@ -0,0 +1,32 @@ +# This workflow will do a clean installation of node dependencies, cache/restore them, run frontend tests across different versions of node (here 22.x) +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs + +name: Frontend Testing + +on: + push: + branches: [ "dev" ] + pull_request: + branches: [ "dev" ] + types: ["synchronize", "ready_for_review", "opened", "reopened"] + +jobs: + test: + name: Run frontend unit tests + if: '! github.event.pull_request.draft' + runs-on: [self-hosted, Linux, X64] + + strategy: + matrix: + node-version: [22.x] + # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ + + 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 From b10f967eedef4c1355480d719fc3a47a7600ca04 Mon Sep 17 00:00:00 2001 From: Timo De Meyst Date: Tue, 25 Mar 2025 22:14:41 +0100 Subject: [PATCH 10/11] actions: gebruik van paths bij testing testing workflows gebruikt paths om enkel te testen als er veranderingen zijn gemaakt die invloed hebben op de testen --- .github/workflows/backend-testing.yml | 12 ++++++++++++ .github/workflows/frontend-testing.yml | 22 ++++++++++++++++++++++ 2 files changed, 34 insertions(+) diff --git a/.github/workflows/backend-testing.yml b/.github/workflows/backend-testing.yml index caec6c07..0d0b1f3f 100644 --- a/.github/workflows/backend-testing.yml +++ b/.github/workflows/backend-testing.yml @@ -3,12 +3,24 @@ name: Backend Testing +# Workflow runs when: +# - a backend js/ts file on "dev" changes +# - a non-draft PR to "dev" with backend js/ts files is opened, is reopened, or changes +# - a draft PR to "dev" with backend js/ts files is marked as ready for review on: push: branches: [ "dev" ] + paths: + - 'backend/src/**.[jt]s' + - 'backend/tests/**.[jt]s' + - 'backend/vitest.config.ts' pull_request: branches: [ "dev" ] types: ["synchronize", "ready_for_review", "opened", "reopened"] + paths: + - 'backend/src/**.[jt]s' + - 'backend/tests/**.[jt]s' + - 'backend/vitest.config.ts' jobs: diff --git a/.github/workflows/frontend-testing.yml b/.github/workflows/frontend-testing.yml index 825065be..ff7bde4d 100644 --- a/.github/workflows/frontend-testing.yml +++ b/.github/workflows/frontend-testing.yml @@ -3,12 +3,34 @@ name: Frontend Testing +# Workflow runs when: +# - a frontend js/ts/vue/css file on "dev" changes +# - a non-draft PR to "dev" with frontend js/ts/vue/css files is opened, is reopened, or changes +# - a draft PR to "dev" with frontend js/ts/vue/css files is marked as ready for review on: push: branches: [ "dev" ] + 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' pull_request: branches: [ "dev" ] types: ["synchronize", "ready_for_review", "opened", "reopened"] + 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' jobs: test: From 1e10af42b532d1e9705f1ecd9063b5e6d8cc4a36 Mon Sep 17 00:00:00 2001 From: Timo De Meyst Date: Tue, 25 Mar 2025 22:31:18 +0100 Subject: [PATCH 11/11] actions: overbodige testing workflow verwijderd testing.yml is opgesplitst in frontend-testing.yml en backend-testing.yml --- .github/workflows/testing.yml | 32 -------------------------------- 1 file changed, 32 deletions(-) delete mode 100644 .github/workflows/testing.yml diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml deleted file mode 100644 index 20e7d221..00000000 --- a/.github/workflows/testing.yml +++ /dev/null @@ -1,32 +0,0 @@ -# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node -# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs - -name: Testing - -on: - push: - branches: [ "dev" ] - pull_request: - branches: [ "dev" ] - types: ["synchronize", "ready_for_review", "opened", "reopened"] - -jobs: - test: - name: Run unit tests - if: '! github.event.pull_request.draft' - runs-on: [self-hosted, Linux, X64] - - strategy: - matrix: - node-version: [22.x] - # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ - - 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