Skip to content
36 changes: 36 additions & 0 deletions .github/workflows/BatchTest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
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: Checkout repository
uses: actions/checkout@v2

- name: Run Batch File
shell: cmd
run: |
call %BATCH_FILE%
timeout /t 5 /nobreak > nul
if exist result.txt (
powershell -Command "if ((Get-Content result.txt).Trim() -eq 'True') { exit 0 } else { exit 1 }"
if %errorlevel%==0 (
echo Test passed.
) else (
echo Test failed.
exit 1
)
) else (
echo Result file not found.
exit 1
)
32 changes: 32 additions & 0 deletions .github/workflows/PRCheck.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: PR Format Check

on:
pull_request:
types: [opened, edited]
branches: [masterTests]


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

if [[ ! "${{ github.event.pull_request.head.ref }}" =~ INVA ]]; then
echo "Error: Branch name must include 'INVA'."
exit 1
fi
4 changes: 4 additions & 0 deletions UnitTest/MyBatchFile.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
@echo on
echo "writing to file"
echo True > result.txt