Update tests.yml #1
Workflow file for this run
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
name: Delphi CI/CD | |
on: | |
push: | |
branches: | |
- net-http | |
jobs: | |
build: | |
runs-on: windows-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Install Docker | |
run: | | |
Invoke-WebRequest -Uri https://desktop.docker.com/win/stable/Docker%20Desktop%20Installer.exe -OutFile DockerDesktopInstaller.exe | |
Start-Process -Wait -FilePath .\DockerDesktopInstaller.exe -ArgumentList '/quiet', '/norestart' | |
- name: Copy Configuration to ntfy | |
run: | | |
# Adjust this command based on the actual location of your configuration file | |
Copy-Item -Path .\tests\server.yml -Destination "${{ github.workspace }}" -Force | |
- name: Start Docker Container | |
run: | | |
# Adjust this command based on the actual container start command | |
Start-Process -Wait -FilePath "docker" -ArgumentList "start", "ntfy" | |
- name: Run Windows Executable | |
id: run-exe | |
run: | | |
# Adjust the path to your Windows executable accordingly | |
"${{ github.workspace }}\bin\win64\NtfyForDelphiTests.exe" > test_results.txt | |
- name: Display Test Results | |
run: | | |
Get-Content test_results.txt | |
- name: Check Exit Code | |
run: | | |
$exitCode = $env:LASTEXITCODE | |
Write-Host "Exit Code: $exitCode" | |
if ($exitCode -eq 0) { | |
Write-Host "All tests passed." | |
} elseif ($exitCode -eq 1) { | |
Write-Host "Some tests failed or had errors." | |
} else { | |
Write-Host "Some tests could not be executed." | |
} | |
exit $exitCode |