From 2edbe1a18f7160cf0dcedee6b5a09c71f4c90ee1 Mon Sep 17 00:00:00 2001 From: Bradley-Augstein_finastra Date: Fri, 28 Feb 2025 14:43:35 +0000 Subject: [PATCH 01/16] simple test with a batch file --- .github/workflows/BatchTest.yml | 32 ++++++++++++++++++++++++++++++++ UnitTest/MyBatchFile.bat | 4 ++++ 2 files changed, 36 insertions(+) create mode 100644 .github/workflows/BatchTest.yml create mode 100644 UnitTest/MyBatchFile.bat diff --git a/.github/workflows/BatchTest.yml b/.github/workflows/BatchTest.yml new file mode 100644 index 0000000..bb0101a --- /dev/null +++ b/.github/workflows/BatchTest.yml @@ -0,0 +1,32 @@ +name: BatchTest + +on: + pull_request: + branches: [masterTests] + push: + branches: [masterTests] + +env: + # Path to the solution file relative to the root of the project. + BATCH_FILE: UnitTest/MyBatchFile.bat + +jobs: + test: + runs-on: windows-latest + steps: + + - name: Run Batch File + run: | + %BATCH_FILE% + if exist result.txt ( + set /p result= result.txt +pause From d3e23fdb0fc8584e8d8831a831af7d641ed7058a Mon Sep 17 00:00:00 2001 From: Bradley-Augstein_finastra Date: Fri, 28 Feb 2025 14:46:53 +0000 Subject: [PATCH 02/16] Batch not working fix --- .github/workflows/BatchTest.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/BatchTest.yml b/.github/workflows/BatchTest.yml index bb0101a..c64d700 100644 --- a/.github/workflows/BatchTest.yml +++ b/.github/workflows/BatchTest.yml @@ -2,9 +2,9 @@ name: BatchTest on: pull_request: - branches: [masterTests] + branches: [master] push: - branches: [masterTests] + branches: [master] env: # Path to the solution file relative to the root of the project. @@ -14,10 +14,10 @@ jobs: test: runs-on: windows-latest steps: - - name: Run Batch File run: | - %BATCH_FILE% + cmd /c %BATCH_FILE% + timeout /t 5 /nobreak > nul if exist result.txt ( set /p result= Date: Fri, 28 Feb 2025 14:47:49 +0000 Subject: [PATCH 03/16] wrong PR branch action --- .github/workflows/BatchTest.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/BatchTest.yml b/.github/workflows/BatchTest.yml index c64d700..f8406cc 100644 --- a/.github/workflows/BatchTest.yml +++ b/.github/workflows/BatchTest.yml @@ -2,9 +2,9 @@ name: BatchTest on: pull_request: - branches: [master] + branches: [masterTests] push: - branches: [master] + branches: [masterTests] env: # Path to the solution file relative to the root of the project. From 17b22181b0e88403f522b2ab2e1a7781f308d726 Mon Sep 17 00:00:00 2001 From: Bradley-Augstein_finastra Date: Fri, 28 Feb 2025 14:55:11 +0000 Subject: [PATCH 04/16] Broken ylm - enclose in " --- .github/workflows/BatchTest.yml | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/BatchTest.yml b/.github/workflows/BatchTest.yml index f8406cc..f2ddd2b 100644 --- a/.github/workflows/BatchTest.yml +++ b/.github/workflows/BatchTest.yml @@ -16,17 +16,19 @@ jobs: steps: - name: Run Batch File run: | - cmd /c %BATCH_FILE% + cmd /c " + %BATCH_FILE% timeout /t 5 /nobreak > nul if exist result.txt ( set /p result= Date: Fri, 28 Feb 2025 14:57:45 +0000 Subject: [PATCH 05/16] cmd shell instead of powershell --- .github/workflows/BatchTest.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/BatchTest.yml b/.github/workflows/BatchTest.yml index f2ddd2b..ed388ae 100644 --- a/.github/workflows/BatchTest.yml +++ b/.github/workflows/BatchTest.yml @@ -15,8 +15,8 @@ jobs: runs-on: windows-latest steps: - name: Run Batch File + shell: cmd run: | - cmd /c " %BATCH_FILE% timeout /t 5 /nobreak > nul if exist result.txt ( @@ -31,4 +31,3 @@ jobs: echo Result file not found. exit 1 ) - " From 1fc8dfdf56a6ca39e1b1ae1bbec4735d72bade58 Mon Sep 17 00:00:00 2001 From: Bradley-Augstein_finastra Date: Fri, 28 Feb 2025 15:05:36 +0000 Subject: [PATCH 06/16] Ensure correct file path --- .github/workflows/BatchTest.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/BatchTest.yml b/.github/workflows/BatchTest.yml index ed388ae..c356bda 100644 --- a/.github/workflows/BatchTest.yml +++ b/.github/workflows/BatchTest.yml @@ -19,8 +19,8 @@ jobs: run: | %BATCH_FILE% timeout /t 5 /nobreak > nul - if exist result.txt ( - set /p result= Date: Fri, 28 Feb 2025 15:08:12 +0000 Subject: [PATCH 07/16] rememebr to checkout... --- .github/workflows/BatchTest.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/BatchTest.yml b/.github/workflows/BatchTest.yml index c356bda..0350aa9 100644 --- a/.github/workflows/BatchTest.yml +++ b/.github/workflows/BatchTest.yml @@ -14,13 +14,16 @@ jobs: test: runs-on: windows-latest steps: + - name: Checkout repository + uses: actions/checkout@v2 + - name: Run Batch File shell: cmd run: | - %BATCH_FILE% + call %BATCH_FILE% timeout /t 5 /nobreak > nul - if exist UnitTest/result.txt ( - set /p result= Date: Fri, 28 Feb 2025 15:10:53 +0000 Subject: [PATCH 08/16] change path --- .github/workflows/BatchTest.yml | 4 ++-- UnitTest/MyBatchFile.bat | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/BatchTest.yml b/.github/workflows/BatchTest.yml index 0350aa9..4282fbd 100644 --- a/.github/workflows/BatchTest.yml +++ b/.github/workflows/BatchTest.yml @@ -22,8 +22,8 @@ jobs: run: | call %BATCH_FILE% timeout /t 5 /nobreak > nul - if exist UnitTest\result.txt ( - set /p result= result.txt -pause + From d067aaa196495f006dc54fa4a26aadd10b9a033c Mon Sep 17 00:00:00 2001 From: Bradley-Augstein_finastra Date: Fri, 28 Feb 2025 15:12:39 +0000 Subject: [PATCH 09/16] test with "True" after fail with "true" --- .github/workflows/BatchTest.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/BatchTest.yml b/.github/workflows/BatchTest.yml index 4282fbd..c79639c 100644 --- a/.github/workflows/BatchTest.yml +++ b/.github/workflows/BatchTest.yml @@ -24,7 +24,7 @@ jobs: timeout /t 5 /nobreak > nul if exist result.txt ( set /p result= Date: Fri, 28 Feb 2025 15:18:12 +0000 Subject: [PATCH 10/16] Change input redirection --- .github/workflows/BatchTest.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/BatchTest.yml b/.github/workflows/BatchTest.yml index c79639c..0e592ff 100644 --- a/.github/workflows/BatchTest.yml +++ b/.github/workflows/BatchTest.yml @@ -23,7 +23,7 @@ jobs: call %BATCH_FILE% timeout /t 5 /nobreak > nul if exist result.txt ( - set /p result= Date: Fri, 28 Feb 2025 15:22:37 +0000 Subject: [PATCH 11/16] Trying still to pass --- .github/workflows/BatchTest.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/BatchTest.yml b/.github/workflows/BatchTest.yml index 0e592ff..c79639c 100644 --- a/.github/workflows/BatchTest.yml +++ b/.github/workflows/BatchTest.yml @@ -23,7 +23,7 @@ jobs: call %BATCH_FILE% timeout /t 5 /nobreak > nul if exist result.txt ( - for /f "tokens=*" %%i in (result.txt) do set result=%%i + set /p result= Date: Fri, 28 Feb 2025 15:25:50 +0000 Subject: [PATCH 12/16] try passing with powershell --- .github/workflows/BatchTest.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/BatchTest.yml b/.github/workflows/BatchTest.yml index c79639c..99427d4 100644 --- a/.github/workflows/BatchTest.yml +++ b/.github/workflows/BatchTest.yml @@ -23,8 +23,8 @@ jobs: call %BATCH_FILE% timeout /t 5 /nobreak > nul if exist result.txt ( - set /p result= Date: Fri, 28 Feb 2025 17:07:06 +0000 Subject: [PATCH 13/16] Add checks on PR itself --- .github/workflows/PRCheck.yml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 .github/workflows/PRCheck.yml diff --git a/.github/workflows/PRCheck.yml b/.github/workflows/PRCheck.yml new file mode 100644 index 0000000..568175d --- /dev/null +++ b/.github/workflows/PRCheck.yml @@ -0,0 +1,25 @@ +name: PR Format Check + +on: + pull_request: + types: [opened, edited] + +jobs: + check-pr-format: + runs-on: ubuntu-latest + + steps: + - name: Check out the repository + uses: actions/checkout@v2 + + - name: Validate PR title and description + run: | + if [[ ! "${{ github.event.pull_request.title }}" =~ ^INVA- ]]; then + echo "Error: PR title must start with 'INVA-'." + exit 1 + fi + + if [[ -z "${{ github.event.pull_request.body }}" ]]; then + echo "Error: PR description must not be empty." + exit 1 + fi \ No newline at end of file From 9916a21e8897ce181f2ae16e369c82f7d79d3bfd Mon Sep 17 00:00:00 2001 From: Bradley-Augstein_finastra Date: Fri, 28 Feb 2025 17:17:00 +0000 Subject: [PATCH 14/16] check branch name contains INVA --- .github/workflows/PRCheck.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/PRCheck.yml b/.github/workflows/PRCheck.yml index 568175d..ed020e6 100644 --- a/.github/workflows/PRCheck.yml +++ b/.github/workflows/PRCheck.yml @@ -22,4 +22,9 @@ jobs: if [[ -z "${{ github.event.pull_request.body }}" ]]; then echo "Error: PR description must not be empty." exit 1 + fi + + if [[ ! "${{ github.event.pull_request.head.ref }}" =~ INVA ]]; then + echo "Error: Branch name must include 'INVA'." + exit 1 fi \ No newline at end of file From 80318218c38536d2f2822a5ee6b73c3a3796b824 Mon Sep 17 00:00:00 2001 From: Bradley-Augstein_finastra Date: Fri, 28 Feb 2025 17:18:31 +0000 Subject: [PATCH 15/16] Additional action on PR itself --- .github/workflows/PRCheck.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/PRCheck.yml b/.github/workflows/PRCheck.yml index ed020e6..12740f7 100644 --- a/.github/workflows/PRCheck.yml +++ b/.github/workflows/PRCheck.yml @@ -3,6 +3,8 @@ name: PR Format Check on: pull_request: types: [opened, edited] + pull_request: + branches: [masterTests] jobs: check-pr-format: From bed532b7f3382dc1a26d0f1b4c1c3bf3fbb5097b Mon Sep 17 00:00:00 2001 From: Bradley-Augstein_finastra Date: Fri, 28 Feb 2025 17:20:00 +0000 Subject: [PATCH 16/16] fixed ylm error --- .github/workflows/PRCheck.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/PRCheck.yml b/.github/workflows/PRCheck.yml index 12740f7..0720132 100644 --- a/.github/workflows/PRCheck.yml +++ b/.github/workflows/PRCheck.yml @@ -3,9 +3,9 @@ name: PR Format Check on: pull_request: types: [opened, edited] - pull_request: branches: [masterTests] + jobs: check-pr-format: runs-on: ubuntu-latest