-
Notifications
You must be signed in to change notification settings - Fork 0
142 lines (141 loc) · 5.95 KB
/
windows_with_mtk.yaml
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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
name: Package for Windows with Tools
on:
workflow_dispatch:
inputs:
git-ref:
description: Branch of gem/oq-builders repository
default: master
required: true
oq-ref:
description: Branch of Openquake Engine
default: master
required: true
oq-rel:
description: Build Number of Openquake Engine
default: 1
required: false
# push:
# branches:
# -
schedule:
- cron: "35 12 * * *"
jobs:
Build_Installer:
runs-on: ubuntu-latest
env:
GEM_SET_BRANCH: ${{ github.event.inputs.oq-ref }}
GEM_SET_BRANCH_TOOLS: ${{ github.event.inputs.oq-ref }}
GEM_SET_RELEASE: ${{ github.event.inputs.oq-rel }}
GEM_SET_BUILD_SCIENCE: 1
GIT_BRANCH: ${{ github.ref }}
GIT_COMMIT_SHA: ${{ github.sha }}
steps:
- name: Clone Repository (Latest)
uses: actions/checkout@v4
if: github.event.inputs.git-ref == ''
- name: Clone Repository (Custom Ref)
uses: actions/checkout@v4
if: github.event.inputs.git-ref != ''
with:
ref: ${{ github.event.inputs.git-ref }}
- name: Docker build of the container and create installer
run: |
echo "Check variable for build packages"
echo "GEM_SET_BRANCH: ${GEM_SET_BRANCH}"
echo "GEM_SET_BRANCH_TOOLS: ${GEM_SET_BRANCH_TOOLS}"
echo "GEM_SET_RELEASE: ${GEM_SET_RELEASE}"
echo "GEM_SET_BUILD_SCIENCE: ${GEM_SET_BUILD_SCIENCE}"
sleep 2
bash -x ci/windows_package.sh
#
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: Installer
path: /home/runner/work/oq-builders/oq-builders/out
retention-days: 5
Test_OQ:
needs: Build_Installer
runs-on: windows-2019
timeout-minutes: 45
steps:
- name: Download Windows Installer from build job
uses: actions/download-artifact@v4
with:
name: Installer
- name: Execute the Installer
run: |
$Install = Get-ChildItem -Filter *.exe
Start-Process -FilePath $Install.Fullname -ArgumentList "/S" -Wait
$env:PATH += ";$env:LOCALAPPDATA\Programs\OpenQuake Engine\python3\Scripts"
Write-Host ${env:PATH}
pwd
- name: Clone Repository (Latest)
uses: actions/checkout@v4
if: github.event.inputs.git-ref == ''
- name: Clone Repository (Custom Ref)
uses: actions/checkout@v4
if: github.event.inputs.git-ref != ''
with:
ref: ${{ github.event.inputs.git-ref }}
- name: Run oq
run: |
$env:PATH += ";$env:LOCALAPPDATA\Programs\OpenQuake Engine\python3\Scripts"
oq.exe --version
oq.exe engine --run "https://downloads.openquake.org/pkgs/test_event_based_risk_inputs_bc.zip"
oq.exe engine --run "https://downloads.openquake.org/jobs/M4_Exercise.zip"
oq.exe engine --list-risk-calculations
- name: Run oq webui console and curl for the standalone tools
run: |
$env:PATH += ";$env:LOCALAPPDATA\Programs\OpenQuake Engine\python3\Scripts"
Write-Host ${env:PATH}
cd "$env:LOCALAPPDATA\Programs\OpenQuake Engine\python3\Scripts"
Start-Job -ScriptBlock{& oq.exe webui start 127.0.0.1:8800 -s 2>&1 > "$env:LOCALAPPDATA\Temp\webui.log" }
ping 127.0.0.1 -n 6 > null
Get-Job
netstat -o -n -a | findstr 8800
Write-Host "Test webui and tools Web pages"
ping 127.0.0.1 -n 6 > null
curl.exe -I -G http://127.0.0.1:8800/engine
ping 127.0.0.1 -n 6 > null
curl.exe -X HEAD -I http://127.0.0.1:8800/ipt/
ping 127.0.0.1 -n 6 > null
curl.exe -X HEAD -I http://127.0.0.1:8800/taxonomy/
ping 127.0.0.1 -n 6 > null
curl.exe -X HEAD -I http://127.0.0.1:8800/taxtweb/
ping 127.0.0.1 -n 6 > null
oq.exe engine --list-risk-calculations
curl.exe -v --fail -G http://127.0.0.1:8800/engine/1/outputs
- name: Upload Artifact WebUI log
uses: actions/upload-artifact@v4
with:
name: WebUI_log
path: C:\\Users\\runneradmin\\AppData\\Local\\Temp\\webui.log
retention-days: 5
- name: Test installation of oq-mbtk
run: |
$env:PATH="$env:LOCALAPPDATA\Programs\OpenQuake Engine\python3"
$env:PATH="$env:PATH;$env:LOCALAPPDATA\Programs\OpenQuake Engine\python3\Scripts"
python.exe -V
cd "$env:LOCALAPPDATA\Programs\OpenQuake Engine"
Remove-Item -Path .\oq-mbtk\openquake\cat\__init__.py
python.exe -m pip install pytest
pytest -vsx .\oq-mbtk\openquake\cat
if: github.event.inputs.oq-science == '1'
- name: Compare files of VMTK
run: |
$env:PATH="$env:LOCALAPPDATA\Programs\OpenQuake Engine\python3"
$env:PATH="$env:PATH;$env:LOCALAPPDATA\Programs\OpenQuake Engine\python3\Scripts"
python.exe -V
cd "$env:LOCALAPPDATA\Programs\OpenQuake Engine"
cd "oq-vmtk\demonstration_files"
dir
python.exe computation_scripts_example_lite.py
cd "outputs\out_dynamic_an_edps_imls\CR_LFINF-CDN_H1"
dir
$dirB = "$env:GITHUB_WORKSPACE\ci\to_compare"
$dirA = "$env:LOCALAPPDATA\Programs\OpenQuake Engine\oq-vmtk\demonstration_files\outputs\out_dynamic_an_edps_imls\CR_LFINF-CDN_H1"
if ( Compare-Object (Get-Content $dirA\max_accels.csv) -DifferenceObject (Get-Content $dirB\max_accels.csv) -SyncWindow 0 ) { exit 1} else {"Files are the same"}
if ( Compare-Object (Get-Content $dirA\imls.csv) -DifferenceObject (Get-Content $dirB\imls.csv) -SyncWindow 0 ) {exit 1} else {"Files are the same"}
if ( Compare-Object (Get-Content $dirA\max_disps.csv) -DifferenceObject (Get-Content $dirB\max_disps.csv) -SyncWindow 0 ) {exit 1} else {"Files are the same"}
if: github.event.inputs.oq-science == '1'