-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
A lot of changes and fixes, which will be described in the release no…
…tes; Added GitHub Actions for testing purposes.
- Loading branch information
Showing
14 changed files
with
594 additions
and
194 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
name: Build | ||
|
||
on: | ||
push: | ||
branches: [ "master" ] | ||
pull_request: | ||
branches: [ "master" ] | ||
|
||
jobs: | ||
build: | ||
runs-on: windows-latest | ||
strategy: | ||
matrix: | ||
build_type: [Debug, Release] | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Checkout master branch | ||
run: git checkout master | ||
|
||
# In order to build we need to use tests branch. | ||
- name: Copy files from master branch to temporary folder | ||
run: | | ||
mkdir "${{github.workspace}}\master_temp" | ||
robocopy "${{github.workspace}}\" "${{github.workspace}}\master_temp" /NFL /E /XD "${{github.workspace}}\master_temp" | ||
# Robocopy will return 1 if successful, so we need to exit with 0 to avoid triggering a failure for this step | ||
if ($LastExitCode -eq 1) { | ||
echo "All files were copied successfully. Continuing..." | ||
exit 0 | ||
} elseif ($LastExitCode -gt 7) { | ||
echo "An error occurred during file copying. Exiting..." | ||
exit $LastExitCode | ||
} | ||
- name: Checkout tests branch | ||
run: | | ||
git checkout tests | ||
- name: Copy master branch files from temporary folder to MasterBranchCode folder | ||
run: | | ||
robocopy "${{github.workspace}}\master_temp" "${{github.workspace}}\MasterBranchCode" /NFL /E | ||
# Robocopy will return 1 if successful, so we need to exit with 0 to avoid triggering a failure for this step | ||
if ($LastExitCode -eq 1) { | ||
echo "All files were copied successfully. Continuing..." | ||
exit 0 | ||
} elseif ($LastExitCode -gt 7) { | ||
echo "An error occurred during file copying. Exiting..." | ||
exit $LastExitCode | ||
} | ||
- name: Configure CMake | ||
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} | ||
|
||
- name: Build | ||
run: cmake --build ${{github.workspace}}/build --config ${{ matrix.build_type }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
name: ContinuousIntegration | ||
|
||
on: | ||
push: | ||
branches: [ "master" ] | ||
pull_request: | ||
branches: [ "master" ] | ||
types: [opened, reopened, synchronize] | ||
|
||
jobs: | ||
ContinuousIntegration: | ||
runs-on: windows-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Checkout master branch | ||
run: git checkout master | ||
|
||
- name: Copy files from master branch to temporary folder | ||
run: | | ||
mkdir "${{github.workspace}}\master_temp" | ||
robocopy "${{github.workspace}}\" "${{github.workspace}}\master_temp" /NFL /E /XD "${{github.workspace}}\master_temp" | ||
# Robocopy will return 1 if successful, so we need to exit with 0 to avoid triggering a failure for this step | ||
if ($LastExitCode -eq 1) { | ||
echo "All files were copied successfully. Continuing..." | ||
exit 0 | ||
} elseif ($LastExitCode -gt 7) { | ||
echo "An error occurred during file copying. Exiting..." | ||
exit $LastExitCode | ||
} | ||
- name: Checkout tests branch | ||
run: git checkout tests | ||
|
||
- name: Copy master branch files from temporary folder to MasterBranchCode folder | ||
run: | | ||
robocopy "${{github.workspace}}\master_temp" "${{github.workspace}}\MasterBranchCode" /NFL /E | ||
# Robocopy will return 1 if successful, so we need to exit with 0 to avoid triggering a failure for this step | ||
if ($LastExitCode -eq 1) { | ||
echo "All files were copied successfully. Continuing..." | ||
exit 0 | ||
} elseif ($LastExitCode -gt 7) { | ||
echo "An error occurred during file copying. Exiting..." | ||
exit $LastExitCode | ||
} | ||
- name: Configure CMake | ||
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=Release | ||
|
||
- name: Build | ||
run: cmake --build ${{github.workspace}}/build --config Release | ||
|
||
- name: Ensure all files are in place | ||
run: | | ||
Move "${{github.workspace}}\build\Release\Visual_Node_System_Tests.exe" "${{github.workspace}}\Visual_Node_System_Tests.exe" | ||
- name: Run test | ||
run: | | ||
$processStartInfo = New-Object System.Diagnostics.ProcessStartInfo | ||
$processStartInfo.FileName = "Visual_Node_System_Tests.exe" | ||
Write-Host "Starting the executable..." | ||
$process = New-Object System.Diagnostics.Process | ||
$process.StartInfo = $processStartInfo | ||
$process.Start() | Out-Null | ||
Write-Host "Executable started." | ||
Write-Host "Waiting for the process to exit..." | ||
$process.WaitForExit(10000) # 10 seconds | ||
if ($process.ExitCode -ne 0) { | ||
Write-Host "Some tests failed. Please check the test results." | ||
exit 1 | ||
} | ||
- name: Print additional test results if failed | ||
if: failure() | ||
run: | | ||
Get-Content "Results.xml" | ForEach-Object { | ||
Write-Host $_ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.