-
Notifications
You must be signed in to change notification settings - Fork 9
85 lines (70 loc) · 2.88 KB
/
ContinuousIntegration.yml
File metadata and controls
85 lines (70 loc) · 2.88 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
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 $_
}