From adebfa35f7313fc43cac44913d0bbee93a57fd19 Mon Sep 17 00:00:00 2001 From: gerwoud Date: Thu, 14 Mar 2024 16:57:14 +0100 Subject: [PATCH 01/16] test example workflow --- backend/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/backend/README.md b/backend/README.md index 8beb249d..be001f5b 100644 --- a/backend/README.md +++ b/backend/README.md @@ -1,4 +1,5 @@ # Project pigeonhole backend +![example workflow](https://github.com/SELab-2/UGent-3/actions/workflows/ci-tests.yml/badge.svg) ## Prerequisites **1. Clone the repo** ```sh From 27310a4e9734df877a0dfc275f5b0b1c695a5298 Mon Sep 17 00:00:00 2001 From: gerwoud Date: Thu, 14 Mar 2024 17:00:30 +0100 Subject: [PATCH 02/16] check if push argument works --- backend/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/README.md b/backend/README.md index be001f5b..a66f9523 100644 --- a/backend/README.md +++ b/backend/README.md @@ -1,5 +1,5 @@ # Project pigeonhole backend -![example workflow](https://github.com/SELab-2/UGent-3/actions/workflows/ci-tests.yml/badge.svg) +![example workflow](https://github.com/SELab-2/UGent-3/actions/workflows/ci-tests.yml/badge.svg?event=push) ## Prerequisites **1. Clone the repo** ```sh From c96f0214d2168603e3568139d88e99a197b2f205 Mon Sep 17 00:00:00 2001 From: gerwoud Date: Thu, 14 Mar 2024 17:02:22 +0100 Subject: [PATCH 03/16] does the value update test --- backend/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/README.md b/backend/README.md index a66f9523..960513bf 100644 --- a/backend/README.md +++ b/backend/README.md @@ -1,5 +1,5 @@ # Project pigeonhole backend -![example workflow](https://github.com/SELab-2/UGent-3/actions/workflows/ci-tests.yml/badge.svg?event=push) +![test](https://github.com/SELab-2/UGent-3/actions/workflows/ci-tests.yml/badge.svg?event=push) ## Prerequisites **1. Clone the repo** ```sh From 2f5ae5213054bdeb392536c99f8c981435319986 Mon Sep 17 00:00:00 2001 From: Gerwoud Van den Eynden <62761483+Gerwoud@users.noreply.github.com> Date: Thu, 14 Mar 2024 17:05:21 +0100 Subject: [PATCH 04/16] Create ci-test-backend.yaml created a seperate file for the backend test --- .github/workflows/ci-test-backend.yaml | 27 ++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 .github/workflows/ci-test-backend.yaml diff --git a/.github/workflows/ci-test-backend.yaml b/.github/workflows/ci-test-backend.yaml new file mode 100644 index 00000000..913674e1 --- /dev/null +++ b/.github/workflows/ci-test-backend.yaml @@ -0,0 +1,27 @@ +name: UGent-3-backend +run-name: ${{ github.actor }} is running backend tests 🚀 +on: [pull_request] +jobs: + Backend-tests: + runs-on: self-hosted + steps: + - uses: actions/checkout@v4 + + - name: Setup Python + uses: actions/setup-python@v5 + with: + python-version: '3.x' + cache: 'pip' + + - name: Install dependencies + working-directory: ./backend + run: pip3 install -r requirements.txt && pip3 install -r dev-requirements.txt + + - name: Running tests + working-directory: ./backend + run: bash ./run_tests.sh + + - name: Run linting + working-directory: ./backend + run: find . -type f -name "*.py" | xargs pylint + From c8586938099849f2e2faf28b2a3e605aa0c6b3bd Mon Sep 17 00:00:00 2001 From: gerwoud Date: Thu, 14 Mar 2024 17:05:50 +0100 Subject: [PATCH 05/16] added backend badge to readme --- backend/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/README.md b/backend/README.md index 960513bf..ea7bfcc5 100644 --- a/backend/README.md +++ b/backend/README.md @@ -1,5 +1,5 @@ # Project pigeonhole backend -![test](https://github.com/SELab-2/UGent-3/actions/workflows/ci-tests.yml/badge.svg?event=push) +![test](https://github.com/SELab-2/UGent-3/actions/workflows/ci-tests-backend.yml/badge.svg?event=push) ## Prerequisites **1. Clone the repo** ```sh From 8590d653d6158e40af4bff5938693ca07cbd3c4c Mon Sep 17 00:00:00 2001 From: gerwoud Date: Thu, 14 Mar 2024 17:06:58 +0100 Subject: [PATCH 06/16] changed yml to yaml --- backend/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/README.md b/backend/README.md index ea7bfcc5..6c7f3a5f 100644 --- a/backend/README.md +++ b/backend/README.md @@ -1,5 +1,5 @@ # Project pigeonhole backend -![test](https://github.com/SELab-2/UGent-3/actions/workflows/ci-tests-backend.yml/badge.svg?event=push) +![test](https://github.com/SELab-2/UGent-3/actions/workflows/ci-tests-backend.yaml/badge.svg?event=push) ## Prerequisites **1. Clone the repo** ```sh From 82934eef2920c86719d4b1f9aea646029d228db5 Mon Sep 17 00:00:00 2001 From: gerwoud Date: Thu, 14 Mar 2024 17:07:35 +0100 Subject: [PATCH 07/16] changed tests to test --- backend/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/README.md b/backend/README.md index 6c7f3a5f..a2b79e10 100644 --- a/backend/README.md +++ b/backend/README.md @@ -1,5 +1,5 @@ # Project pigeonhole backend -![test](https://github.com/SELab-2/UGent-3/actions/workflows/ci-tests-backend.yaml/badge.svg?event=push) +![test](https://github.com/SELab-2/UGent-3/actions/workflows/ci-test-backend.yaml/badge.svg?event=push) ## Prerequisites **1. Clone the repo** ```sh From df9d792dee0a638cf03f4be503fea909f10e816f Mon Sep 17 00:00:00 2001 From: gerwoud Date: Thu, 14 Mar 2024 17:15:22 +0100 Subject: [PATCH 08/16] added seperate files for linter and tests for both front and backend --- .github/workflows/ci-linter-backend.yaml | 0 .github/workflows/ci-linter-frontend.yaml | 0 .github/workflows/ci-test-frontend.yaml | 0 3 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 .github/workflows/ci-linter-backend.yaml create mode 100644 .github/workflows/ci-linter-frontend.yaml create mode 100644 .github/workflows/ci-test-frontend.yaml diff --git a/.github/workflows/ci-linter-backend.yaml b/.github/workflows/ci-linter-backend.yaml new file mode 100644 index 00000000..e69de29b diff --git a/.github/workflows/ci-linter-frontend.yaml b/.github/workflows/ci-linter-frontend.yaml new file mode 100644 index 00000000..e69de29b diff --git a/.github/workflows/ci-test-frontend.yaml b/.github/workflows/ci-test-frontend.yaml new file mode 100644 index 00000000..e69de29b From 20f3cadb2a1973ad633460830382a7386c8bd48f Mon Sep 17 00:00:00 2001 From: gerwoud Date: Thu, 14 Mar 2024 17:16:42 +0100 Subject: [PATCH 09/16] gave correct names to workflows --- .github/workflows/ci-linter-backend.yaml | 22 ++++++++++++++ .github/workflows/ci-linter-frontend.yaml | 35 +++++++++++++++++++++++ .github/workflows/ci-test-backend.yaml | 2 +- .github/workflows/ci-test-frontend.yaml | 35 +++++++++++++++++++++++ 4 files changed, 93 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci-linter-backend.yaml b/.github/workflows/ci-linter-backend.yaml index e69de29b..a9d56c74 100644 --- a/.github/workflows/ci-linter-backend.yaml +++ b/.github/workflows/ci-linter-backend.yaml @@ -0,0 +1,22 @@ +name: UGent-3-backend-linter +run-name: ${{ github.actor }} is running backend tests 🚀 +on: [pull_request] +jobs: + Backend-tests: + runs-on: self-hosted + steps: + - uses: actions/checkout@v4 + + - name: Setup Python + uses: actions/setup-python@v5 + with: + python-version: '3.x' + cache: 'pip' + + - name: Install dependencies + working-directory: ./backend + run: pip3 install -r requirements.txt && pip3 install -r dev-requirements.txt + + - name: Run linting + working-directory: ./backend + run: find . -type f -name "*.py" | xargs pylint \ No newline at end of file diff --git a/.github/workflows/ci-linter-frontend.yaml b/.github/workflows/ci-linter-frontend.yaml index e69de29b..532e60ef 100644 --- a/.github/workflows/ci-linter-frontend.yaml +++ b/.github/workflows/ci-linter-frontend.yaml @@ -0,0 +1,35 @@ +name: UGent-3-frontend-linter +run-name: ${{ github.actor }} is running tests 🚀 +on: [pull_request] +jobs: + Frontend-tests: + runs-on: self-hosted + steps: + - uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + + - name: Cache dependencies + uses: actions/cache@v4 + with: + path: ~/.npm + key: npm-${{ hashFiles('package-lock.json') }} + restore-keys: npm- + + - name: Install dependencies + working-directory: ./frontend + run: npm ci + + - name: Build + working-directory: ./frontend + run: npm run build + + - name: Preview Web App + working-directory: ./frontend + run: npm run preview & + + - name: Run linting + working-directory: ./frontend + run: npm run lint + \ No newline at end of file diff --git a/.github/workflows/ci-test-backend.yaml b/.github/workflows/ci-test-backend.yaml index 913674e1..610a254d 100644 --- a/.github/workflows/ci-test-backend.yaml +++ b/.github/workflows/ci-test-backend.yaml @@ -1,4 +1,4 @@ -name: UGent-3-backend +name: UGent-3-backend-test run-name: ${{ github.actor }} is running backend tests 🚀 on: [pull_request] jobs: diff --git a/.github/workflows/ci-test-frontend.yaml b/.github/workflows/ci-test-frontend.yaml index e69de29b..9231841c 100644 --- a/.github/workflows/ci-test-frontend.yaml +++ b/.github/workflows/ci-test-frontend.yaml @@ -0,0 +1,35 @@ +name: UGent-3-frontend-test +run-name: ${{ github.actor }} is running tests 🚀 +on: [pull_request] +jobs: + Frontend-tests: + runs-on: self-hosted + steps: + - uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + + - name: Cache dependencies + uses: actions/cache@v4 + with: + path: ~/.npm + key: npm-${{ hashFiles('package-lock.json') }} + restore-keys: npm- + + - name: Install dependencies + working-directory: ./frontend + run: npm ci + + - name: Build + working-directory: ./frontend + run: npm run build + + - name: Preview Web App + working-directory: ./frontend + run: npm run preview & + + - name: Running tests + working-directory: ./frontend + run: npm test + From 33ec72012054c503df7d1facfc3c72267c4fe247 Mon Sep 17 00:00:00 2001 From: gerwoud Date: Thu, 14 Mar 2024 17:18:15 +0100 Subject: [PATCH 10/16] correct names to run name --- .github/workflows/ci-linter-backend.yaml | 2 +- .github/workflows/ci-linter-frontend.yaml | 2 +- .github/workflows/ci-test-frontend.yaml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci-linter-backend.yaml b/.github/workflows/ci-linter-backend.yaml index a9d56c74..2b52c0ea 100644 --- a/.github/workflows/ci-linter-backend.yaml +++ b/.github/workflows/ci-linter-backend.yaml @@ -1,5 +1,5 @@ name: UGent-3-backend-linter -run-name: ${{ github.actor }} is running backend tests 🚀 +run-name: ${{ github.actor }} is running backend linter 🚀 on: [pull_request] jobs: Backend-tests: diff --git a/.github/workflows/ci-linter-frontend.yaml b/.github/workflows/ci-linter-frontend.yaml index 532e60ef..5b27b9ab 100644 --- a/.github/workflows/ci-linter-frontend.yaml +++ b/.github/workflows/ci-linter-frontend.yaml @@ -1,5 +1,5 @@ name: UGent-3-frontend-linter -run-name: ${{ github.actor }} is running tests 🚀 +run-name: ${{ github.actor }} is running frontend linter 🚀 on: [pull_request] jobs: Frontend-tests: diff --git a/.github/workflows/ci-test-frontend.yaml b/.github/workflows/ci-test-frontend.yaml index 9231841c..8d976eb4 100644 --- a/.github/workflows/ci-test-frontend.yaml +++ b/.github/workflows/ci-test-frontend.yaml @@ -1,5 +1,5 @@ name: UGent-3-frontend-test -run-name: ${{ github.actor }} is running tests 🚀 +run-name: ${{ github.actor }} is running frontend tests 🚀 on: [pull_request] jobs: Frontend-tests: From d73dac4abdb5017cce75715a4f3c76932ca1e288 Mon Sep 17 00:00:00 2001 From: gerwoud Date: Thu, 14 Mar 2024 17:22:57 +0100 Subject: [PATCH 11/16] removed code dupe and pray for test run --- .github/workflows/ci-test-backend.yaml | 5 +-- .github/workflows/ci-tests.yml | 62 -------------------------- 2 files changed, 1 insertion(+), 66 deletions(-) delete mode 100644 .github/workflows/ci-tests.yml diff --git a/.github/workflows/ci-test-backend.yaml b/.github/workflows/ci-test-backend.yaml index 610a254d..5335aa08 100644 --- a/.github/workflows/ci-test-backend.yaml +++ b/.github/workflows/ci-test-backend.yaml @@ -20,8 +20,5 @@ jobs: - name: Running tests working-directory: ./backend run: bash ./run_tests.sh - - - name: Run linting - working-directory: ./backend - run: find . -type f -name "*.py" | xargs pylint + diff --git a/.github/workflows/ci-tests.yml b/.github/workflows/ci-tests.yml deleted file mode 100644 index bd101643..00000000 --- a/.github/workflows/ci-tests.yml +++ /dev/null @@ -1,62 +0,0 @@ -name: UGent-3 -run-name: ${{ github.actor }} is running tests 🚀 -on: [pull_request] -jobs: - Frontend-tests: - runs-on: self-hosted - steps: - - uses: actions/checkout@v4 - - - name: Setup Node.js - uses: actions/setup-node@v4 - - - name: Cache dependencies - uses: actions/cache@v4 - with: - path: ~/.npm - key: npm-${{ hashFiles('package-lock.json') }} - restore-keys: npm- - - - name: Install dependencies - working-directory: ./frontend - run: npm ci - - - name: Build - working-directory: ./frontend - run: npm run build - - - name: Preview Web App - working-directory: ./frontend - run: npm run preview & - - - name: Running tests - working-directory: ./frontend - run: npm test - - - name: Run linting - working-directory: ./frontend - run: npm run lint - Backend-tests: - runs-on: self-hosted - steps: - - uses: actions/checkout@v4 - - - name: Setup Python - uses: actions/setup-python@v5 - with: - python-version: '3.x' - cache: 'pip' - - - name: Install dependencies - working-directory: ./backend - run: pip3 install -r requirements.txt && pip3 install -r dev-requirements.txt - - - name: Running tests - working-directory: ./backend - run: bash ./run_tests.sh - - - name: Run linting - working-directory: ./backend - run: find . -type f -name "*.py" | xargs pylint - - From 3f4d226af0898cb2af061b8277563a687d5c4311 Mon Sep 17 00:00:00 2001 From: gerwoud Date: Thu, 14 Mar 2024 17:26:27 +0100 Subject: [PATCH 12/16] added both badges for linter and tests from backend --- backend/README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/backend/README.md b/backend/README.md index a2b79e10..cf384bb9 100644 --- a/backend/README.md +++ b/backend/README.md @@ -1,5 +1,6 @@ # Project pigeonhole backend -![test](https://github.com/SELab-2/UGent-3/actions/workflows/ci-test-backend.yaml/badge.svg?event=push) +![test](https://github.com/SELab-2/UGent-3/actions/workflows/ci-test-backend.yaml/badge.svg) +![test](https://github.com/SELab-2/UGent-3/actions/workflows/ci-linter-backend.yaml/badge.svg) ## Prerequisites **1. Clone the repo** ```sh From e5da8d8c52e79b61f0cfd5f83e193f43f64f899b Mon Sep 17 00:00:00 2001 From: gerwoud Date: Thu, 14 Mar 2024 17:28:23 +0100 Subject: [PATCH 13/16] file changes detected? --- backend/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/README.md b/backend/README.md index cf384bb9..b7cd5ee4 100644 --- a/backend/README.md +++ b/backend/README.md @@ -1,6 +1,6 @@ # Project pigeonhole backend -![test](https://github.com/SELab-2/UGent-3/actions/workflows/ci-test-backend.yaml/badge.svg) -![test](https://github.com/SELab-2/UGent-3/actions/workflows/ci-linter-backend.yaml/badge.svg) +![tests](https://github.com/SELab-2/UGent-3/actions/workflows/ci-test-backend.yaml/badge.svg) +![linter](https://github.com/SELab-2/UGent-3/actions/workflows/ci-linter-backend.yaml/badge.svg) ## Prerequisites **1. Clone the repo** ```sh From 17d31dbe178db27fe3d2767b359c487349108b3e Mon Sep 17 00:00:00 2001 From: gerwoud Date: Thu, 14 Mar 2024 17:39:20 +0100 Subject: [PATCH 14/16] removed unused code parts --- .github/workflows/ci-linter-backend.yaml | 4 ---- .github/workflows/ci-linter-frontend.yaml | 12 ------------ 2 files changed, 16 deletions(-) diff --git a/.github/workflows/ci-linter-backend.yaml b/.github/workflows/ci-linter-backend.yaml index 2b52c0ea..ae449a19 100644 --- a/.github/workflows/ci-linter-backend.yaml +++ b/.github/workflows/ci-linter-backend.yaml @@ -13,10 +13,6 @@ jobs: python-version: '3.x' cache: 'pip' - - name: Install dependencies - working-directory: ./backend - run: pip3 install -r requirements.txt && pip3 install -r dev-requirements.txt - - name: Run linting working-directory: ./backend run: find . -type f -name "*.py" | xargs pylint \ No newline at end of file diff --git a/.github/workflows/ci-linter-frontend.yaml b/.github/workflows/ci-linter-frontend.yaml index 5b27b9ab..1e3d8708 100644 --- a/.github/workflows/ci-linter-frontend.yaml +++ b/.github/workflows/ci-linter-frontend.yaml @@ -16,18 +16,6 @@ jobs: path: ~/.npm key: npm-${{ hashFiles('package-lock.json') }} restore-keys: npm- - - - name: Install dependencies - working-directory: ./frontend - run: npm ci - - - name: Build - working-directory: ./frontend - run: npm run build - - - name: Preview Web App - working-directory: ./frontend - run: npm run preview & - name: Run linting working-directory: ./frontend From 03f9fc844970d9cb4963176733e1f8c6d16d07aa Mon Sep 17 00:00:00 2001 From: gerwoud Date: Thu, 14 Mar 2024 17:58:23 +0100 Subject: [PATCH 15/16] fix: eslint not found error --- .github/workflows/ci-linter-backend.yaml | 3 ++- .github/workflows/ci-linter-frontend.yaml | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci-linter-backend.yaml b/.github/workflows/ci-linter-backend.yaml index ae449a19..d9bb1150 100644 --- a/.github/workflows/ci-linter-backend.yaml +++ b/.github/workflows/ci-linter-backend.yaml @@ -15,4 +15,5 @@ jobs: - name: Run linting working-directory: ./backend - run: find . -type f -name "*.py" | xargs pylint \ No newline at end of file + run: find . -type f -name "*.py" | xargs pylint + \ No newline at end of file diff --git a/.github/workflows/ci-linter-frontend.yaml b/.github/workflows/ci-linter-frontend.yaml index 1e3d8708..f93d6325 100644 --- a/.github/workflows/ci-linter-frontend.yaml +++ b/.github/workflows/ci-linter-frontend.yaml @@ -16,6 +16,10 @@ jobs: path: ~/.npm key: npm-${{ hashFiles('package-lock.json') }} restore-keys: npm- + + - name: Install dependencies + working-directory: ./frontend + run: npm i eslint - name: Run linting working-directory: ./frontend From d6a85461f73676368e8e99ba0f44f4eb25bb484c Mon Sep 17 00:00:00 2001 From: gerwoud Date: Thu, 14 Mar 2024 19:26:08 +0100 Subject: [PATCH 16/16] added frontend badges --- frontend/README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/frontend/README.md b/frontend/README.md index 0d6babed..be6865ac 100644 --- a/frontend/README.md +++ b/frontend/README.md @@ -1,3 +1,7 @@ +# Project pigeonhole backend +![tests](https://github.com/SELab-2/UGent-3/actions/workflows/ci-test-frontend.yaml/badge.svg) +![linter](https://github.com/SELab-2/UGent-3/actions/workflows/ci-linter-frontend.yaml/badge.svg) + # React + TypeScript + Vite This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.