-
Notifications
You must be signed in to change notification settings - Fork 52
182 lines (158 loc) · 5.81 KB
/
windows.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
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
name: Windows Build
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
release:
types:
- published
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
runs-on: [ self-hosted, windows, x64 ]
strategy:
fail-fast: false
matrix:
config:
- mode: Debug
webui: Off
- mode: Release
webui: On
env:
CXX: cl.exe
CC: cl.exe
BUILDCACHE_COMPRESS: true
BUILDCACHE_DIRECT_MODE: true
BUILDCACHE_ACCURACY: SLOPPY # not suitable for coverage/debugging
BUILDCACHE_DIR: ${{ github.workspace }}/.buildcache
BUILDCACHE_LUA_PATH: ${{ github.workspace }}/tools
BUILDCACHE_MAX_CACHE_SIZE: 1073741824
steps:
- uses: actions/checkout@v3
# ==== RESTORE CACHE ====
- name: Restore buildcache Cache
run: |
$buildcachePath = "${{ runner.tool_cache }}\${{ github.event.repository.name }}\buildcache-${{ matrix.config.mode }}"
New-Item -ItemType Directory -Force -Path $buildcachePath
New-Item -Path ${{ github.workspace }}/.buildcache -ItemType SymbolicLink -Value $buildcachePath
- name: Restore Dependencies Cache
run: |
$depsPath = "${{ runner.tool_cache }}\${{ github.event.repository.name }}\deps"
New-Item -ItemType Directory -Force -Path $depsPath
New-Item -Path ${{ github.workspace }}\deps\ -ItemType SymbolicLink -Value $depsPath
# ==== BUILD ====
- uses: ilammy/msvc-dev-cmd@v1
- name: Build
run: |
git config --global core.autocrlf input
cmake `
-GNinja -S . -B build `
-DCMAKE_BUILD_TYPE=${{ matrix.config.mode }} `
-DMOTIS_DEBUG_SYMBOLS=OFF `
-DMOTIS_AVX2=${{ matrix.config.webui }} `
-DMOTIS_AVX=${{ matrix.config.webui }} `
-DMOTIS_WITH_WEBUI=${{ matrix.config.webui }}
.\build\buildcache\bin\buildcache.exe -z
cmake --build build --target `
motis `
motis-test `
motis-itest
$CompilerExitCode = $LastExitCode
.\build\buildcache\bin\buildcache.exe -s
exit $CompilerExitCode
# ==== TESTS ====
- name: Run Test Mode
if: matrix.config.webui == 'Off'
run: >
.\build\motis.exe
--mode test
--import.paths schedule:base/loader/test_resources/hrd_schedules/single-ice
--dataset.begin 20151004
--dataset.write_serialized false
--nigiri.no_cache true
--exclude_modules address osrm parking path ppr tiles gbfs
- name: Run Tests
if: matrix.config.webui == 'Off'
run: .\build\motis-test.exe
- name: Run Integration Tests
if: matrix.config.webui == 'Off'
run: .\build\motis-itest.exe
# ==== WEB INTERFACE ====
- name: Compile Web Interface
if: matrix.config.webui == 'On'
run: |
cmake --build build --target motis-web-ui
rm -r ui/web/elm-stuff
rm -r ui/web/src
- name: Install RSL Web Interface Dependencies
uses: pnpm/action-setup@v2
if: matrix.config.webui == 'On'
with:
version: ^8.6.12
run_install: |
- cwd: ./ui/rsl
- name: Compile RSL Web Interface
if: matrix.config.webui == 'On'
run: pnpm run build
working-directory: ./ui/rsl
# ==== API DOCS ====
- name: Install Protocol Tool Dependencies
if: matrix.config.mode == 'Release'
uses: pnpm/action-setup@v2
with:
version: ^8.6.12
run_install: |
- cwd: tools/protocol
- name: Run Protocol Tool
if: matrix.config.mode == 'Release'
run: pnpm start --skip rsl-ui
working-directory: tools/protocol
# ==== DISTRIBUTION ====
- name: Move Profiles
if: matrix.config.mode == 'Release'
run: |
Copy-Item .\deps\osrm-backend\profiles .\osrm-profiles -Recurse
Copy-Item .\deps\ppr\profiles .\ppr-profiles -Recurse
Copy-Item .\deps\tiles\profile .\tiles-profiles -Recurse
- name: Move Web UI
if: matrix.config.mode == 'Release'
run: |
mkdir web
Copy-Item .\ui\web\external_lib,.\ui\web\img,.\ui\web\js,.\ui\web\style .\web\ -Recurse
Copy-Item .\ui\web\*.html,.\ui\web\*.js,.\ui\web\*.ico .\web\
Copy-Item .\ui\web\openapi .\web\ -Recurse
Copy-Item .\ui\rsl\dist .\web\rsl -Recurse
- name: Move API Docs
if: matrix.config.mode == 'Release'
run: |
Copy-Item .\docs\generated\openapi-3.1\openapi.yaml .\web\openapi\openapi.yaml
Copy-Item .\docs\generated\openapi-3.0\openapi.yaml .\web\openapi\openapi-3.0.yaml
- name: Create Distribution
if: matrix.config.mode == 'Release'
run: >
7z a motis-windows${{ matrix.config.tag }}.zip
.\build\motis.exe
.\osrm-profiles
.\ppr-profiles
.\tiles-profiles
.\web
- name: Upload Distribution
if: matrix.config.mode == 'Release'
uses: actions/upload-artifact@v1
with:
name: motis-windows${{ matrix.config.tag }}
path: motis-windows${{ matrix.config.tag }}.zip
# ==== RELEASE ====
- name: Upload Release
if: github.event.action == 'published' && matrix.config.mode == 'Release'
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./motis-windows${{ matrix.config.tag }}.zip
asset_name: motis-windows${{ matrix.config.tag }}.zip
asset_content_type: application/zip