forked from dynawo/dynawo
-
Notifications
You must be signed in to change notification settings - Fork 0
158 lines (139 loc) · 8.37 KB
/
ci.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
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
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
name: CI
on: [push]
defaults:
run:
shell: bash
jobs:
build-linux:
runs-on: ubuntu-latest
container: dynawo/dynawo-ci:latest
env:
DYNAWO_BUILD_TYPE: Debug
DYNAWO_COMPILER: GCC
DYNAWO_RESULTS_SHOW: "false"
DYNAWO_INSTALL_OPENMODELICA: /opt/OpenModelica/Install
DYNAWO_SRC_OPENMODELICA: /opt/OpenModelica/Source
DYNAWO_NB_PROCESSORS_USED: 2
steps:
- name: Checkout sources
uses: actions/checkout@v1
- name: Build
run: |
export DYNAWO_HOME=$(pwd)
util/envDynawo.sh build-user
- name: Update Docker Hub
env:
DOCKER_HUB_TOKEN1: ${{ secrets.DOCKER_HUB_TOKEN1 }}
DOCKER_HUB_TOKEN2: ${{ secrets.DOCKER_HUB_TOKEN2 }}
if: github.ref == 'refs/heads/master' && github.event_name == 'push'
run: curl -sw '%{http_code}\n' --header "Content-Type":" application/json" -X POST --data '{"dynawo":"Update"}' https://hub.docker.com/api/build/v1/source/$DOCKER_HUB_TOKEN1/trigger/$DOCKER_HUB_TOKEN2/call/
- name: Doxygen build
if: github.ref == 'refs/heads/master' && github.event_name == 'push'
run: |
export DYNAWO_HOME=$(pwd)
util/envDynawo.sh build-doxygen-doc
- name: Deploy to GitHub Pages
if: github.ref == 'refs/heads/master' && github.event_name == 'push'
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./install/gcc8/HEAD/Debug/shared/dynawo/doxygen/html
coverage:
runs-on: ubuntu-latest
container: dynawo/dynawo-ci:latest
env:
DYNAWO_COMPILER: GCC
DYNAWO_RESULTS_SHOW: "false"
DYNAWO_INSTALL_OPENMODELICA: /opt/OpenModelica/Install
DYNAWO_SRC_OPENMODELICA: /opt/OpenModelica/Source
DYNAWO_NB_PROCESSORS_USED: 2
steps:
- name: Install Sonar wrapper
working-directory: ${{ runner.workspace }}
env:
CONTAINER_WORKSPACE: ${{ runner.workspace }}
run: |
wget https://sonarcloud.io/static/cpp/build-wrapper-linux-x86.zip
unzip build-wrapper-linux-x86.zip
- name: Install Sonar scanner
working-directory: ${{ runner.workspace }}
env:
SONAR_SCANNER_VERSION: 4.6.0.2311
run: |
wget https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-${SONAR_SCANNER_VERSION}.zip
unzip sonar-scanner-cli-${SONAR_SCANNER_VERSION}.zip
ln -s sonar-scanner-${SONAR_SCANNER_VERSION} sonar
rm sonar-scanner-cli-${SONAR_SCANNER_VERSION}.zip
dnf install -y java-11-openjdk
- name: Checkout sources
uses: actions/checkout@v1
# In a PR use pre-built 3rd parties to optimize the duration of the job
- name: Build branch PR
env:
CONTAINER_WORKSPACE: ${{ runner.workspace }}
DYNAWO_THIRD_PARTY_INSTALL_DIR: /opt/dynawo/3rParty
if: github.ref != 'refs/heads/master' && github.event_name == 'push'
run: |
export DYNAWO_HOME=$(pwd)
$CONTAINER_WORKSPACE/build-wrapper-linux-x86/build-wrapper-linux-x86-64 --out-dir bw-output util/envDynawo.sh build-tests-coverage
- name: Build master
env:
CONTAINER_WORKSPACE: ${{ runner.workspace }}
DYNAWO_BUILD_TYPE: Debug
if: github.ref == 'refs/heads/master' && github.event_name == 'push'
run: |
export DYNAWO_HOME=$(pwd)
util/envDynawo.sh build-3rd-party
$CONTAINER_WORKSPACE/build-wrapper-linux-x86/build-wrapper-linux-x86-64 --out-dir bw-output util/envDynawo.sh build-tests-coverage
- name: Sonarcloud
working-directory: ${{ runner.workspace }}/dynawo
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
CONTAINER_WORKSPACE: ${{ runner.workspace }}
run: $CONTAINER_WORKSPACE/sonar/bin/sonar-scanner -Dsonar.host.url=https://sonarcloud.io -Dsonar.cfamily.threads=2
build-windows:
runs-on: windows-2019
steps:
- name: Checkout sources
uses: actions/checkout@v3
- name: Git move
shell: cmd
run: |
cd ..
move dynawo \
md dynawo
- name: Install wget
shell: cmd
run: choco install wget --no-progress
- name: Install OpenModelica and Third Parties
shell: cmd
run: |
cd \
wget -nv https://github.com/dynawo/dynawo/releases/download/nightly/OpenModelica-windows.zip
7z x OpenModelica-windows.zip
wget -nv https://github.com/dynawo/dynawo/releases/download/nightly/dynawo-3rd-parties-windows.zip
7z x dynawo-3rd-parties-windows.zip
ren dynawo-3rd-parties-windows d-3-p
- name: Build Dynawo
shell: cmd
run: |
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
cd \dynawo
set PATH=C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.29.30133\bin\HostX64\x64;C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\IDE\VC\VCPackages;C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\IDE\CommonExtensions\Microsoft\TestWindow;C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer;C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\bin\Roslyn;C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Team Tools\Performance Tools\x64;C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Team Tools\Performance Tools;C:\Program Files (x86)\Microsoft Visual Studio\Shared\Common\VSPerfCollectionTools\vs2019\\x64;C:\Program Files (x86)\Microsoft Visual Studio\Shared\Common\VSPerfCollectionTools\vs2019\;C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.8 Tools\x64\;C:\Program Files (x86)\Windows Kits\10\bin\10.0.22621.0\x64;C:\Program Files (x86)\Windows Kits\10\bin\x64;C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\\MSBuild\Current\Bin;C:\Windows\Microsoft.NET\Framework64\v4.0.30319;C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\IDE\;C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\Tools\;C:\vcpkg;C:\Program Files (x86)\GitHub CLI;C:\Program Files\Git\bin;C:\hostedtoolcache\windows\Python\3.7.9\x64\Scripts;C:\hostedtoolcache\windows\Python\3.7.9\x64;C:\hostedtoolcache\windows\Java_Temurin-Hotspot_jdk\8.0.352-8\x64\bin;C:\Program Files\Eclipse Foundation\jdk-8.0.302.8-hotspot\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\ProgramData\Chocolatey\bin;C:\Program Files\PowerShell\7\;C:\Program Files\OpenSSL\bin;C:\Program Files\CMake\bin;C:\ProgramData\chocolatey\lib\maven\apache-maven-3.8.6\bin;C:\Program Files\Git\cmd;C:\Program Files\Git\mingw64\bin;C:\Program Files\Git\usr\bin;C:\Program Files\GitHub CLI\;C:\Users\runneradmin\AppData\Local\Microsoft\WindowsApps;C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin;C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\IDE\CommonExtensions\Microsoft\CMake\Ninja;
cmake -Wno-dev -S dynawo -B b -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=../d-i -DDYNAWO_HOME=.. -DINSTALL_OPENMODELICA=../../OpenModelica -DDYNAWO_THIRD_PARTY_DIR=../../d-3-p -G "NMake Makefiles"
cmake --build b --target install || exit /b 1
cmake --build b --target models-cpp || exit /b 1
cmake --build b --target SMIB_MODELS || exit /b 1
cmake --build b --target LoadAlphaBeta || exit /b 1
cmake --build b --target GeneratorSynchronousFourWindingsProportionalRegulations || exit /b 1
cmake --build b --target GeneratorSynchronousThreeWindingsProportionalRegulations || exit /b 1
cmake --build b --target solvers || exit /b 1
- name: Dynawo runtime
shell: cmd
run: |
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
cd \dynawo
D:\d-i\dynawo.cmd jobs nrt\data\SMIB\SMIB_BasicTestCases\SMIB_1_StepPm\SMIB.jobs
echo %ERRORLEVEL%
D:\d-i\dynawo.cmd jobs nrt\data\IEEE14\IEEE14_SyntaxExamples\IEEE14_BlackBoxModels\IEEE14.jobs