From 32f05d3326192f8f262d7aff4c379b67095b3dc2 Mon Sep 17 00:00:00 2001 From: Thanusha Rathnayake Date: Thu, 15 Jan 2026 11:30:30 +0530 Subject: [PATCH 01/13] test: trigger workflow --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 2e74d1a8..fdbd86eb 100644 --- a/README.md +++ b/README.md @@ -608,4 +608,7 @@ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file **Happy Learning!** 🎓 +Learning GitHub Actions 🚀 + + From 9e1b03a757e38a3c905a85159150fc0de413d05c Mon Sep 17 00:00:00 2001 From: Thanusha Rathnayake <147828365+Thanus31@users.noreply.github.com> Date: Fri, 8 May 2026 10:55:38 +0530 Subject: [PATCH 02/13] Add comment to hello-world.yml Added a comment to the Hello World Workflow file. --- .github/workflows/hello-world.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/hello-world.yml b/.github/workflows/hello-world.yml index 376deaa8..105b1beb 100644 --- a/.github/workflows/hello-world.yml +++ b/.github/workflows/hello-world.yml @@ -1,5 +1,7 @@ name: Hello World Workflow +#Thans31 + on: push: branches: [main, develop] From 6f4b5ec5d5f3330a64a24654c78cd8f11088b4da Mon Sep 17 00:00:00 2001 From: Thanusha Rathnayake Date: Fri, 8 May 2026 10:57:52 +0530 Subject: [PATCH 03/13] add comment --- .github/workflows/hello-world.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/hello-world.yml b/.github/workflows/hello-world.yml index 376deaa8..245b4e88 100644 --- a/.github/workflows/hello-world.yml +++ b/.github/workflows/hello-world.yml @@ -1,5 +1,7 @@ name: Hello World Workflow +#Thanus31 + on: push: branches: [main, develop] From be89eccd8b9fba992f0cc080343e9f001cf3f749 Mon Sep 17 00:00:00 2001 From: Thanusha Rathnayake Date: Fri, 8 May 2026 11:16:18 +0530 Subject: [PATCH 04/13] add custom workflow --- .github/workflows/custom.yml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 .github/workflows/custom.yml diff --git a/.github/workflows/custom.yml b/.github/workflows/custom.yml new file mode 100644 index 00000000..dc0585c6 --- /dev/null +++ b/.github/workflows/custom.yml @@ -0,0 +1,22 @@ +name: Custom Workflow + +on: + push: + branches: [develop] + +jobs: + custom-job: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Setup Node.js + uses: actions/setup-node@v3 + with: + node-version: '18' + + - name: Install and Test + run: | + cd sample-app + npm install + npm test \ No newline at end of file From 1fe7b0f1915e46406a54dff41241a6084dd6cf7d Mon Sep 17 00:00:00 2001 From: Thanusha Rathnayake Date: Fri, 8 May 2026 11:18:22 +0530 Subject: [PATCH 05/13] add environmrnt veriables --- .github/workflows/custom.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/custom.yml b/.github/workflows/custom.yml index dc0585c6..6bbdc362 100644 --- a/.github/workflows/custom.yml +++ b/.github/workflows/custom.yml @@ -7,9 +7,17 @@ on: jobs: custom-job: runs-on: ubuntu-latest + env: + NODE_ENV: test + LOG_LEVEL: debug steps: - uses: actions/checkout@v3 + - name: Print environment + run: | + echo "Environment: ${{ env.NODE_ENV }}" + echo "Log Level: ${{ env.LOG_LEVEL }}" + - name: Setup Node.js uses: actions/setup-node@v3 with: From 9de493e0ee2616c0ee6c85d9eb8a2551ee5e86f7 Mon Sep 17 00:00:00 2001 From: Thanusha Rathnayake Date: Fri, 8 May 2026 11:37:34 +0530 Subject: [PATCH 06/13] update custom woekflow --- .github/workflows/custom.yml | 38 +++++++++++++++++++++++++----------- 1 file changed, 27 insertions(+), 11 deletions(-) diff --git a/.github/workflows/custom.yml b/.github/workflows/custom.yml index 6bbdc362..69e78a2d 100644 --- a/.github/workflows/custom.yml +++ b/.github/workflows/custom.yml @@ -2,29 +2,45 @@ name: Custom Workflow on: push: - branches: [develop] + branches: + - develop jobs: custom-job: runs-on: ubuntu-latest + env: NODE_ENV: test LOG_LEVEL: debug + + strategy: + matrix: + node-version: [16.x, 18.x, 20.x] + steps: - - uses: actions/checkout@v3 + - name: Checkout Code + uses: actions/checkout@v3 - - name: Print environment + - name: Print Environment Variables run: | - echo "Environment: ${{ env.NODE_ENV }}" - echo "Log Level: ${{ env.LOG_LEVEL }}" + echo "Environment: $NODE_ENV" + echo "Log Level: $LOG_LEVEL" + + - name: Access Secret + env: + TEST_SECRET: ${{ secrets.TEST_SECRET }} + run: | + echo "Secret loaded successfully" - name: Setup Node.js uses: actions/setup-node@v3 with: - node-version: '18' + node-version: ${{ matrix.node-version }} - - name: Install and Test - run: | - cd sample-app - npm install - npm test \ No newline at end of file + - name: Install Dependencies + working-directory: ./sample-app + run: npm install + + - name: Run Tests + working-directory: ./sample-app + run: npm test \ No newline at end of file From a5ecdd419a985cde31f5dbbbb980c790fbbcac7d Mon Sep 17 00:00:00 2001 From: Thanusha Rathnayake Date: Fri, 8 May 2026 11:42:45 +0530 Subject: [PATCH 07/13] Updated node version to 22 --- .github/workflows/build-test.yml | 114 ++++++++----------------------- 1 file changed, 30 insertions(+), 84 deletions(-) diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index 877f81c7..a1aac6e6 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -1,100 +1,46 @@ -name: Build and Test +name: Custom Workflow on: push: - branches: [main, develop] - paths: - - 'sample-app/**' - - '.github/workflows/build-test.yml' - pull_request: - branches: [main] - workflow_dispatch: + branches: + - develop jobs: - build-and-test: - name: Build and Test + custom-job: runs-on: ubuntu-latest - + + env: + NODE_ENV: test + LOG_LEVEL: debug + strategy: matrix: - node-version: [16.x, 18.x] - + node-version: [22.x] + steps: - - name: Checkout code + - name: Checkout Code uses: actions/checkout@v3 - - - name: Setup Node.js ${{ matrix.node-version }} + + - name: Print Environment Variables + run: | + echo "Environment: $NODE_ENV" + echo "Log Level: $LOG_LEVEL" + + - name: Access Secret + env: + TEST_SECRET: ${{ secrets.TEST_SECRET }} + run: | + echo "Secret loaded successfully" + + - name: Setup Node.js uses: actions/setup-node@v3 with: node-version: ${{ matrix.node-version }} - cache: 'npm' - cache-dependency-path: 'sample-app/package-lock.json' - - - name: Install dependencies - working-directory: ./sample-app - run: npm ci - - - name: Run linter - working-directory: ./sample-app - run: npm run lint - continue-on-error: true - - - name: Build application - working-directory: ./sample-app - run: npm run build - - - name: Run tests - working-directory: ./sample-app - run: npm test - - - name: Upload coverage reports - if: matrix.node-version == '18.x' - uses: actions/upload-artifact@v3 - with: - name: coverage-report-${{ matrix.node-version }} - path: sample-app/coverage/ - retention-days: 30 - - - name: Check coverage - if: always() - working-directory: ./sample-app - run: | - if [ -f coverage/coverage-summary.json ]; then - echo "✅ Coverage report generated" - else - echo "⚠️ No coverage report found" - fi - lint-check: - name: Lint Check - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v3 - - - uses: actions/setup-node@v3 - with: - node-version: '18' - cache: 'npm' - cache-dependency-path: 'sample-app/package-lock.json' - - - working-directory: ./sample-app - run: npm ci - - - name: Run ESLint + - name: Install Dependencies working-directory: ./sample-app - run: npm run lint - continue-on-error: true + run: npm install - test-summary: - name: Test Summary - runs-on: ubuntu-latest - needs: [build-and-test] - if: always() - - steps: - - name: Print test results - run: | - echo "🎯 Test Run Summary" - echo "===================" - echo "✅ All tests completed" + - name: Run Tests + working-directory: ./sample-app + run: npm test \ No newline at end of file From 4aebe5cbda0ddc1465aa1252f16f459822c2fa10 Mon Sep 17 00:00:00 2001 From: Thanusha Rathnayake Date: Fri, 8 May 2026 12:00:58 +0530 Subject: [PATCH 08/13] Added artifact upload/download --- .github/workflows/build-test.yml | 43 +++++++++++++++++++------------- 1 file changed, 25 insertions(+), 18 deletions(-) diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index a1aac6e6..32467756 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -1,4 +1,4 @@ -name: Custom Workflow +name: Build Test Workflow on: push: @@ -6,13 +6,9 @@ on: - develop jobs: - custom-job: + build: runs-on: ubuntu-latest - env: - NODE_ENV: test - LOG_LEVEL: debug - strategy: matrix: node-version: [22.x] @@ -21,17 +17,6 @@ jobs: - name: Checkout Code uses: actions/checkout@v3 - - name: Print Environment Variables - run: | - echo "Environment: $NODE_ENV" - echo "Log Level: $LOG_LEVEL" - - - name: Access Secret - env: - TEST_SECRET: ${{ secrets.TEST_SECRET }} - run: | - echo "Secret loaded successfully" - - name: Setup Node.js uses: actions/setup-node@v3 with: @@ -43,4 +28,26 @@ jobs: - name: Run Tests working-directory: ./sample-app - run: npm test \ No newline at end of file + run: npm test + + - name: Create Artifact + run: echo "Build output" > output.txt + + - name: Upload Artifact + uses: actions/upload-artifact@v4 + with: + name: build-output + path: output.txt + + download-artifact: + needs: build + runs-on: ubuntu-latest + + steps: + - name: Download Artifact + uses: actions/download-artifact@v4 + with: + name: build-output + + - name: Show Artifact Content + run: cat output.txt \ No newline at end of file From 3c6ffcae92326a36443fcf18e5090fb307e08e53 Mon Sep 17 00:00:00 2001 From: Thanusha Rathnayake Date: Fri, 8 May 2026 12:03:56 +0530 Subject: [PATCH 09/13] Added conditional workflow --- .github/workflows/conditional.yml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 .github/workflows/conditional.yml diff --git a/.github/workflows/conditional.yml b/.github/workflows/conditional.yml new file mode 100644 index 00000000..dcea03fb --- /dev/null +++ b/.github/workflows/conditional.yml @@ -0,0 +1,19 @@ +name: Conditional Workflow + +on: + push: + branches: + - develop + - main + +jobs: + conditional-job: + runs-on: ubuntu-latest + + steps: + - name: Always Run + run: echo "This step always runs" + + - name: Deploy (main only) + if: github.ref == 'refs/heads/main' + run: echo "Deploying to production..." \ No newline at end of file From 46ffb770d69d1077b30411643230b18925266de6 Mon Sep 17 00:00:00 2001 From: Thanusha Rathnayake Date: Fri, 8 May 2026 12:07:00 +0530 Subject: [PATCH 10/13] Updated sample app --- sample-app/README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sample-app/README.md b/sample-app/README.md index dd6b4f4d..0d64144a 100644 --- a/sample-app/README.md +++ b/sample-app/README.md @@ -154,4 +154,6 @@ The app includes a health check endpoint at `/health` which returns HTTP 200 whe --- +Updated sample app documentation + **Happy learning! 🎓** From 9297b528ffa9febcb3807046becf9dd5b01dd85f Mon Sep 17 00:00:00 2001 From: Thanusha Rathnayake Date: Fri, 8 May 2026 16:17:02 +0530 Subject: [PATCH 11/13] Added artifact workflow --- .github/workflows/build-test.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index 32467756..2d18b559 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -4,6 +4,8 @@ on: push: branches: - develop + - main + - working-advanced-anastasia jobs: build: From f348dcc0eb226899477b80befb6479dfdd786768 Mon Sep 17 00:00:00 2001 From: Thanusha Rathnayake Date: Fri, 8 May 2026 16:18:32 +0530 Subject: [PATCH 12/13] Added conditional workflow --- .github/workflows/conditional.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/conditional.yml b/.github/workflows/conditional.yml index dcea03fb..90a69b12 100644 --- a/.github/workflows/conditional.yml +++ b/.github/workflows/conditional.yml @@ -5,6 +5,7 @@ on: branches: - develop - main + - working-advanced-anastasia jobs: conditional-job: From 3cea5b32ad74922e08e5ea9a99e2ead81edc37c5 Mon Sep 17 00:00:00 2001 From: Thanusha Rathnayake Date: Fri, 8 May 2026 16:19:37 +0530 Subject: [PATCH 13/13] Updated README --- sample-app/README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sample-app/README.md b/sample-app/README.md index 0d64144a..fe08eba7 100644 --- a/sample-app/README.md +++ b/sample-app/README.md @@ -156,4 +156,6 @@ The app includes a health check endpoint at `/health` which returns HTTP 200 whe Updated sample app documentation +GitHub Actions practice update + **Happy learning! 🎓**