[WIP] Add Route Choice #377
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: WindowsReleaseTest | |
on: | |
push: | |
branches: [develop] | |
pull_request: | |
schedule: | |
- cron: '0 8 * * *' | |
jobs: | |
windows_test: | |
runs-on: windows-latest | |
strategy: | |
matrix: | |
# we test the minimum LTR version required, the newest LTR, and the latest. | |
version: [qgis-ltr --version=3.34.10] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install QGIS on Chocolatey | |
uses: crazy-max/ghaction-chocolatey@v3 | |
with: | |
args: install ${{ matrix.version }} -y | |
# Currently skipping tests with relative path to test folder | |
- name: Setup and test plugin on Latest | |
shell: pwsh | |
if: ${{ (matrix.version == 'qgis')}} | |
run: | | |
$qgisPath = (Get-ChildItem -Path "C:\Program Files" -Filter "QGIS*" -Directory).FullName | |
$qgisExec = "$qgisPath\bin\python-qgis.bat" | |
$pluginPath = "$env:APPDATA\QGIS\QGIS3\profiles\default\python\plugins" | |
$aeqPath = "$pluginPath\qaequilibrae" | |
Copy-Item "qaequilibrae" -Destination "$aeqPath" -Recurse | |
Copy-Item "test" -Destination "$pluginPath\test" -Recurse | |
$env:PYTHONPATH = "$qgisPath\apps\qgis\python" | |
$env:QT_QPA_PLATFORM = "offscreen" | |
Start-Process -FilePath "$qgisExec" -ArgumentList "-m pip install -r $pluginPath\test\requirements_test.txt" -NoNewWindow -Wait | |
Set-Location "$aeqPath" | |
Start-Process -FilePath "$qgisExec" -ArgumentList "download_extra_packages_class.py" -NoNewWindow -Wait | |
$env:PYTHONPATH = "$env:PYTHONPATH;APPDATA\QGIS\QGIS3\profiles\default\python\plugins" | |
Set-Location "$pluginPath" | |
Start-Process -FilePath "$qgisExec" -ArgumentList "-m pytest test --report-log=.\log.jsonl" -NoNewWindow -Wait | |
- name: Setup and test plugin on LTR | |
shell: pwsh | |
if: ${{ (matrix.version != 'qgis')}} | |
run: | | |
$qgisPath = (Get-ChildItem -Path "C:\Program Files" -Filter "QGIS*" -Directory).FullName | |
$qgisExec = "$qgisPath\bin\python-qgis-ltr.bat" | |
$pluginPath = "$env:APPDATA\QGIS\QGIS3\profiles\default\python\plugins" | |
$aeqPath = "$pluginPath\qaequilibrae" | |
Copy-Item "qaequilibrae" -Destination "$aeqPath" -Recurse | |
Copy-Item "test" -Destination "$pluginPath\test" -Recurse | |
$env:PYTHONPATH = "$qgisPath\apps\qgis\python" | |
$env:QT_QPA_PLATFORM = "offscreen" | |
Start-Process -FilePath "$qgisExec" -ArgumentList "-m pip install -r $pluginPath\test\requirements_test.txt" -NoNewWindow -Wait | |
Set-Location "$aeqPath" | |
Start-Process -FilePath "$qgisExec" -ArgumentList "download_extra_packages_class.py" -NoNewWindow -Wait | |
$env:PYTHONPATH = "$env:PYTHONPATH;APPDATA\QGIS\QGIS3\profiles\default\python\plugins" | |
Set-Location "$pluginPath" | |
Start-Process -FilePath "$qgisExec" -ArgumentList "-m pytest test --report-log=$pluginPath\log.jsonl" -NoNewWindow -Wait | |
- name: Check packages installed | |
shell: pwsh | |
run: | | |
Get-ChildItem -Path "$env:APPDATA\QGIS\QGIS3\profiles\default\python\plugins\qaequilibrae\packages" -Name | |
- name: Check if tests failed | |
shell: pwsh | |
run: | | |
$pluginPath = "$env:APPDATA\QGIS\QGIS3\profiles\default\python\plugins" | |
$fails = Select-String -Path .\*.jsonl -Pattern 'failed' | |
if ($fails.Matches.Length -gt 0) { | |
Write-Error "Check for errors in the tests run" | |
exit 1 | |
} |