Skip to content

Commit

Permalink
Add opencv test.
Browse files Browse the repository at this point in the history
  • Loading branch information
viferga committed Dec 11, 2024
1 parent dc241a1 commit dd34621
Show file tree
Hide file tree
Showing 3 changed files with 138 additions and 0 deletions.
133 changes: 133 additions & 0 deletions .github/workflows/test-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,29 @@ jobs:
metacall faas --version | findstr /R "^v.*\..*\..*"
IF %ERRORLEVEL% NEQ 0 exit /B 1
- name: Uninstall MetaCall
shell: cmd
env:
METACALL_INSTALL_DEBUG: 1
run: |
powershell -NoProfile -ExecutionPolicy unrestricted ./install.ps1 -Uninstall
- name: Uninstall Test
shell: pwsh
run: |
$MetaCallPath = "$env:LocalAppData\MetaCall"
Write-Output "Checking MetaCall installation directory: $MetaCallPath"
If (Test-Path $MetaCallPath) {
Write-Error "MetaCall installation directory still exists"
exit 1
}
$MetaCallBinary = (Get-Command metacall -ErrorAction SilentlyContinue)
If ($MetaCallBinary) {
Write-Error "MetaCall binary is still available"
exit 2
}
Write-Output "Uninstall verification passed."
install-from-path:
name: Install MetaCall via Path Installation
runs-on: windows-latest
Expand Down Expand Up @@ -84,6 +107,29 @@ jobs:
metacall faas --version | findstr /R "^v.*\..*\..*"
IF %ERRORLEVEL% NEQ 0 exit /B 1
- name: Uninstall MetaCall
shell: cmd
env:
METACALL_INSTALL_DEBUG: 1
run: |
powershell -NoProfile -ExecutionPolicy unrestricted ./install.ps1 -Uninstall
- name: Uninstall Test
shell: pwsh
run: |
$MetaCallPath = "$env:LocalAppData\MetaCall"
Write-Output "Checking MetaCall installation directory: $MetaCallPath"
If (Test-Path $MetaCallPath) {
Write-Error "MetaCall installation directory still exists"
exit 1
}
$MetaCallBinary = (Get-Command metacall -ErrorAction SilentlyContinue)
If ($MetaCallBinary) {
Write-Error "MetaCall binary is still available"
exit 2
}
Write-Output "Uninstall verification passed."
install-path-with-whitespaces:
name: Install MetaCall via Path With Whitespaces
runs-on: windows-latest
Expand Down Expand Up @@ -127,3 +173,90 @@ jobs:
IF %ERRORLEVEL% NEQ 0 exit /B 1
metacall faas --version | findstr /R "^v.*\..*\..*"
IF %ERRORLEVEL% NEQ 0 exit /B 1
- name: Uninstall MetaCall
shell: cmd
env:
METACALL_INSTALL_DEBUG: 1
run: |
powershell -NoProfile -ExecutionPolicy unrestricted ./install.ps1 -Uninstall -InstallDir '%cd%\install folder with spaces'
- name: Uninstall Test
shell: pwsh
run: |
$MetaCallPath = Join-Path (Get-Location) "install folder with spaces"
Write-Output "Checking MetaCall installation directory: $MetaCallPath"
If (Test-Path $MetaCallPath) {
Write-Error "MetaCall installation directory still exists"
exit 1
}
$MetaCallBinary = (Get-Command metacall -ErrorAction SilentlyContinue)
If ($MetaCallBinary) {
Write-Error "MetaCall binary is still available"
exit 2
}
Write-Output "Uninstall verification passed."
install-version-opencv:
name: Install MetaCall with Specific Version
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Install MetaCall
powershell -NoProfile -ExecutionPolicy unrestricted ./install.ps1 -Version 0.1.7

- name: NodeJS Test
shell: cmd
run: |
metacall ./test/script.js | findstr "123456"
IF %ERRORLEVEL% NEQ 0 exit /B 1
- name: Python Test
shell: cmd
run: |
metacall pip install -r test/requirements.txt | findstr "Successfully installed"
IF %ERRORLEVEL% NEQ 0 exit /B 1
metacall ./test/requirements.py | findstr "123456"
IF %ERRORLEVEL% NEQ 0 exit /B 1
- name: Python OpenCV Test
shell: cmd
run: |
metacall pip install -r test/opencv/requirements.txt
# | findstr "Successfully installed"
# IF %ERRORLEVEL% NEQ 0 exit /B 1
metacall ./test/opencv/opencv.py
# | findstr "123456"
# IF %ERRORLEVEL% NEQ 0 exit /B 1

- name: Deploy & FaaS Test
shell: cmd
run: |
metacall deploy --version | findstr /R "^v.*\..*\..*"
IF %ERRORLEVEL% NEQ 0 exit /B 1
metacall faas --version | findstr /R "^v.*\..*\..*"
IF %ERRORLEVEL% NEQ 0 exit /B 1
- name: Uninstall MetaCall
shell: cmd
env:
METACALL_INSTALL_DEBUG: 1
run: |
powershell -NoProfile -ExecutionPolicy unrestricted ./install.ps1 -Uninstall
- name: Uninstall Test
shell: pwsh
run: |
$MetaCallPath = "$env:LocalAppData\MetaCall"
Write-Output "Checking MetaCall installation directory: $MetaCallPath"
If (Test-Path $MetaCallPath) {
Write-Error "MetaCall installation directory still exists"
exit 1
}
$MetaCallBinary = (Get-Command metacall -ErrorAction SilentlyContinue)
If ($MetaCallBinary) {
Write-Error "MetaCall binary is still available"
exit 2
}
Write-Output "Uninstall verification passed."
3 changes: 3 additions & 0 deletions test/opencv/opencv.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import cv2
print(cv2.__version__)
print('123456')
2 changes: 2 additions & 0 deletions test/opencv/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
opencv-contrib-python-headless==3.3.0.9
numpy==1.21.6

0 comments on commit dd34621

Please sign in to comment.