Skip to content

Commit accff30

Browse files
committed
feat: finished testing environment and versioning
- Whenever there's a commit or PR: - Simba is downloaded (32 and 64 bits) - The repo is checked out into ./Includes - We run Simba (32 and 64 bits) on all simba files in ./Includes/SRLT/tests - When this is done, if it succeeded and it was triggered by a push, we release a new version
1 parent 4980c62 commit accff30

File tree

3 files changed

+36
-6
lines changed

3 files changed

+36
-6
lines changed

.github/workflows/tests.yml

Lines changed: 30 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,33 @@ jobs:
5050

5151
- name: Run tests
5252
run: |
53-
Get-ChildItem -Recurse
54-
./Simba-Win32.exe --run ./Includes/SRLT/tests/compile.simba
55-
./Simba-Win64.exe --run ./Includes/SRLT/tests/compile.simba
53+
# Get all .simba files in the tests folder, sorted numerically
54+
$testFiles = Get-ChildItem -Path ./Includes/SRLT/tests/*.simba | Sort-Object Name
55+
56+
# Check if any test files were found
57+
if ($testFiles.Count -eq 0) {
58+
Write-Output "::error::No .simba test files found."
59+
exit 1
60+
}
61+
62+
# Run each test file
63+
foreach ($testFile in $testFiles) {
64+
Write-Output "Running test: $($testFile.FullName)"
65+
66+
# Run Simba-Win32.exe
67+
$output32 = .\Simba-Win32.exe --run $testFile.FullName
68+
Write-Output $output32
69+
if (-not ($output32 -match "Successfully executed")) {
70+
Write-Output "::error::Simba-Win32.exe failed on $($testFile.Name)."
71+
exit 1
72+
}
73+
74+
# Run Simba-Win64.exe
75+
$output64 = .\Simba-Win64.exe --run $testFile.FullName
76+
Write-Output $output64
77+
if (-not ($output64 -match "Successfully executed")) {
78+
Write-Output "::error::Simba-Win64.exe failed on $($testFile.Name)."
79+
exit 1
80+
}
81+
}
82+

.github/workflows/version.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
name: Version
22

33
on:
4-
push:
5-
branches:
6-
- main
4+
workflow_run:
5+
workflows: ["Tests"]
6+
types:
7+
- completed
78

89
jobs:
910
version:
11+
if: > ${{ github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.event == 'push' }}
1012
runs-on: ubuntu-latest
1113

1214
steps:
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1+
//compile test
12
{$I SRLT/osrs.simba}
23

0 commit comments

Comments
 (0)