-
Notifications
You must be signed in to change notification settings - Fork 277
109 lines (106 loc) · 4.21 KB
/
windows_full_test.yml
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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
name: Windows full tests of OpenQuake Engine
on:
push:
branches: [windows-all-tests]
# workflow_dispatch:
# inputs:
# git-ref:
# description: Git Ref
# default: master
# required: true
# push:
# branches: [ ae-win_numba ]
jobs:
install_and_test:
runs-on: windows-latest
env:
GITHUB_PULL_REQUEST: ${{ github.event.number }}
GITHUB_DEF_BR: ${{ github.event.repository.default_branch }}
GITHUB_REF: ${{ github.ref }}
GITHUB_HD_REF: ${{ github.head_ref }}
GITHUB_BS_REF: ${{ github.base_ref }}
BRANCH: ${{ github.event.inputs.git-ref }}
strategy:
matrix:
python-version: ["3.10"]
steps:
- name: Check out the codebase.
uses: actions/checkout@v2
# This Checkout use git-ref keyword from dispatch
- name: Clone Repository (Master)
uses: actions/checkout@v2
if: github.event.inputs.git-ref == ''
- name: Clone Repository (Custom Ref)
uses: actions/checkout@v2
if: github.event.inputs.git-ref != ''
with:
ref: ${{ github.event.inputs.git-ref }}
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
# You can test your matrix by printing the current Python version
- name: Display Python version
run: python -c "import sys; print(sys.version)"
- name: Echo env var
env:
BRANCH: ${{ github.event.inputs.git-ref }}
run: |
echo "${Env:environment}"
Write-Host $Env:GITHUB_REF
echo "Branch environment"
Write-Host $Env:BRANCH
- name: Install engine on developer mode
env:
BRANCH: ${{ github.event.inputs.git-ref }}
run: |
set PIP_DEFAULT_TIMEOUT=100
python -m pip install pip --upgrade
#echo Branch to test %BRANCH%
#if %BRANCH%=="" (python install.py devel) else (python install.py devel --version %BRANCH%)
write-Host "Branch to test $($Env:BRANCH)"
if ($Env:BRANCH)
{
Write-Host "Install with workflow_dispatch"
Write-Host "python install.py devel --version ${env:BRANCH}"
python install.py devel --version ${env:BRANCH}
}
else
{
Write-Host "Install on scheduled task"
Write-Host "python install.py devel "
python install.py devel
}
- name: Run all demos
run: |
C:\Users\runneradmin\openquake\Scripts\activate.ps1
# FIXME: why those different exports? (using the same as in run-demos.sh)
oq --version
Start-Job -ScriptBlock{& 'C:\Users\runneradmin\openquake\Scripts\oq.exe' dbserver start}
# Write-Host "Run all demos having only job.ini"
# $iniFilePaths = Get-ChildItem D:\a\oq-engine\oq-engine\demos -Recurse -Filter job.ini
# foreach($iniFilePath in $iniFilePaths) {
# Write-Host "Run $($iniFilePath.FullName)"
# oq engine --run $iniFilePath.FullName --exports xml,hdf5 -p pointsource_distance=0 -r
# }
Write-Host "Run all demos having only job_hazard.ini and job_risk.ini"
$demoDirs = Get-ChildItem D:\a\oq-engine\oq-engine\demos -Recurse -Directory
foreach($demoDir in $demoDirs) {
$jobHazardPaths = Get-ChildItem $demoDir -Filter job_hazard.ini
foreach($jobHazardPath in $jobHazardPaths) {
Write-Host "Run $($jobHazardPath.FullName)"
oq engine --run $jobHazardPath.FullName --exports npz -p pointsource_distance=0
$jobRiskPath = $demoDir.FullName + "\job_risk.ini"
Write-Host "Run $($jobRiskPath)"
oq engine --run $jobRiskPath --hc -1
}
}
- name: Run all engine tests
run: |
C:\Users\runneradmin\openquake\Scripts\activate.ps1
#
#python -c 'import fiona'
oq --version
Start-Job -ScriptBlock{& 'C:\Users\runneradmin\openquake\Scripts\oq.exe' dbserver start}
python -m pip install pytest
pytest -vs --color=yes D:\a\oq-engine\oq-engine\openquake