From 14a5f95dbf6a083b6434573a8d04b76bc0dddd26 Mon Sep 17 00:00:00 2001 From: Dartman3450 <154795740+Dartman3450@users.noreply.github.com> Date: Mon, 17 Nov 2025 14:15:18 +0700 Subject: [PATCH 1/8] adding ci yml to repository --- .github/workflows/ci.yml | 41 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000000..01e342d698 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,41 @@ +name : CI Example voting app +on: + push : + branches : [ "main" ] + pull_request : + branches : [ "main" ] + +jobs: + build-and-test: + runs-on : ubuntu-latest + + steps : + - name: checkout-repositories + uses: action/checkout@v3 + + - name: Setup Node + uses: actions/setup-node@v3 + with: + node-version: '18' + + - name: Install dependencies (vote) + working-directory: vote + run: npm install + + - name: Run tests (vote) + working-directory: vote + run: npm test --if-present + + # Test Python worker + - name: Setup Python + uses: actions/setup-python@v4 + with: + python-version: '3.10' + + - name: Install Python deps (worker) + working-directory: worker + run: pip install -r requirements.txt + + - name: Run Python tests (worker) + working-directory: worker + run: pytest || echo "No tests found" From 1bd89df4a255b525b42255bfe88a43fbbd96452c Mon Sep 17 00:00:00 2001 From: Dartman3450 <154795740+Dartman3450@users.noreply.github.com> Date: Mon, 17 Nov 2025 21:34:15 +0700 Subject: [PATCH 2/8] changing main to master on branches for CI.YML --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 01e342d698..c681c70349 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,9 +1,9 @@ name : CI Example voting app on: push : - branches : [ "main" ] + branches : [ "master" ] pull_request : - branches : [ "main" ] + branches : [ "master" ] jobs: build-and-test: From cf82a03c14b8fdcd575cac1bd18672a43da0f601 Mon Sep 17 00:00:00 2001 From: Dartman3450 <154795740+Dartman3450@users.noreply.github.com> Date: Mon, 17 Nov 2025 21:40:38 +0700 Subject: [PATCH 3/8] repairing syntax on second line --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c681c70349..d7be9d9204 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,6 +1,6 @@ name : CI Example voting app on: - push : + push: branches : [ "master" ] pull_request : branches : [ "master" ] From c40debe69025947b7f58bc023a9e5a170f1ffb4a Mon Sep 17 00:00:00 2001 From: Dartman3450 <154795740+Dartman3450@users.noreply.github.com> Date: Mon, 17 Nov 2025 21:47:36 +0700 Subject: [PATCH 4/8] repairing syntax --- .github/workflows/ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d7be9d9204..9107c7f798 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,8 +1,8 @@ -name : CI Example voting app -on: +- name: CI Example voting app +- on: push: branches : [ "master" ] - pull_request : +- pull_request: branches : [ "master" ] jobs: From f3c2bf2d317ba1e6e7023755558a22dc8ce7a72b Mon Sep 17 00:00:00 2001 From: Dartman3450 <154795740+Dartman3450@users.noreply.github.com> Date: Mon, 17 Nov 2025 21:53:20 +0700 Subject: [PATCH 5/8] repairing syntax because misplacement : --- .github/workflows/ci.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9107c7f798..26d697b8c4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,15 +1,16 @@ -- name: CI Example voting app -- on: +name: CI Example voting app + +on: push: branches : [ "master" ] -- pull_request: + pull_request: branches : [ "master" ] jobs: build-and-test: - runs-on : ubuntu-latest + runs-on: ubuntu-latest - steps : + steps: - name: checkout-repositories uses: action/checkout@v3 From 694e1894bd78274dbe7c014eb153e1271962fc55 Mon Sep 17 00:00:00 2001 From: Dartman3450 <154795740+Dartman3450@users.noreply.github.com> Date: Mon, 17 Nov 2025 22:07:31 +0700 Subject: [PATCH 6/8] repairing syntax --- .github/workflows/ci.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 26d697b8c4..7a203e96b4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,9 +7,8 @@ on: branches : [ "master" ] jobs: - build-and-test: + build-and-test: runs-on: ubuntu-latest - steps: - name: checkout-repositories uses: action/checkout@v3 @@ -27,7 +26,6 @@ jobs: working-directory: vote run: npm test --if-present - # Test Python worker - name: Setup Python uses: actions/setup-python@v4 with: From e1cd2106b38fe5ad52597b7633e3a8a6efe0c54c Mon Sep 17 00:00:00 2001 From: Dartman3450 <154795740+Dartman3450@users.noreply.github.com> Date: Mon, 17 Nov 2025 22:24:00 +0700 Subject: [PATCH 7/8] repairing whole syntax --- .github/workflows/ci.yml | 68 +++++++++++++++++++++------------------- 1 file changed, 36 insertions(+), 32 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7a203e96b4..857cca7ef3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,40 +1,44 @@ -name: CI Example voting app +name: CI Pipeline - Vote and Worker Services on: push: - branches : [ "master" ] + branches: + - master pull_request: - branches : [ "master" ] + branches: + - master jobs: - build-and-test: + build-and-test: runs-on: ubuntu-latest + steps: - - name: checkout-repositories - uses: action/checkout@v3 - - - name: Setup Node - uses: actions/setup-node@v3 - with: - node-version: '18' - - - name: Install dependencies (vote) - working-directory: vote - run: npm install - - - name: Run tests (vote) - working-directory: vote - run: npm test --if-present - - - name: Setup Python - uses: actions/setup-python@v4 - with: - python-version: '3.10' - - - name: Install Python deps (worker) - working-directory: worker - run: pip install -r requirements.txt - - - name: Run Python tests (worker) - working-directory: worker - run: pytest || echo "No tests found" + + - name: Checkout Repositories + uses: actions/checkout@v3 + + - name: Setup Node.js + uses: actions/setup-node@v3 + with: + node-version: '18' + + - name: Install Dependencies (vote) + working-directory: vote + run: npm install + + - name: Run Tests (vote) + working-directory: vote + run: npm test --if-present + + - name: Setup Python + uses: actions/setup-python@v4 + with: + python-version: '3.10' + + - name: Install Python Deps (worker) + working-directory: worker + run: pip install -r requirements.txt + + - name: Run Python tests (worker) + working-directory: worker + run: pytest || echo "No tests found" From 94494662c0d730b887a0ad323517e0f0075b48df Mon Sep 17 00:00:00 2001 From: Dartman3450 <154795740+Dartman3450@users.noreply.github.com> Date: Mon, 17 Nov 2025 22:38:55 +0700 Subject: [PATCH 8/8] Minor change on Readme --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 8516424ba1..0d63fc0b03 100644 --- a/README.md +++ b/README.md @@ -63,3 +63,5 @@ The voting application only accepts one vote per client browser. It does not reg This isn't an example of a properly architected perfectly designed distributed app... it's just a simple example of the various types of pieces and languages you might see (queues, persistent data, etc), and how to deal with them in Docker at a basic level. + +