-
Notifications
You must be signed in to change notification settings - Fork 17
152 lines (146 loc) · 4.77 KB
/
Copy pathmain.yml
File metadata and controls
152 lines (146 loc) · 4.77 KB
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
name: CI
on:
schedule:
- cron: "20 3 * * 2"
pull_request:
types: [opened, reopened, synchronize, ready_for_review]
push:
branches:
- 'main'
tags:
- v*
workflow_dispatch:
jobs:
build:
strategy:
matrix:
config: ["Debug", "Release"]
os: ["ubuntu-latest", "ubuntu-22.04", "windows-2022", "windows-latest"]
exclude:
- os: windows-2022
config: Debug
- os: windows-latest
config: Debug
runs-on: ${{ matrix.os }}
steps:
# On the Github-hosted runner, git checks out text files with \r\n (I think)
# which messes up some unit tests, specifically UtilsTest.loadFileToString,
# which expects TestData/minimal.xml not to have any carriage returns \r.
# So we have to overwrite this checkout policy here:
- name: Set git to use LF instead of CRLF
if: startsWith(matrix.os, 'windows')
run: |
git config --global core.autocrlf false
git config --global core.eol lf
- uses: actions/checkout@v6
with:
submodules: recursive
- name: Setup pixi
uses: prefix-dev/setup-pixi@v0.9.4
with:
cache: true
cache-write: ${{ github.event_name == 'push' && github.ref_name == 'main' }}
- name: Install Matlab libs
if: startsWith(matrix.os, 'windows')
run: |
md c:\tixi-3rdparty -Force | Out-Null
If (!(Test-Path -Path "c:\tixi-3rdparty\matlab-libs-win")) {
Write-Output "Downloading matlab libraries"
Invoke-WebRequest -UserAgent "Wget" -Uri "https://sourceforge.net/projects/tixi/files/dev-tools/matlab-libs-win.zip" -OutFile "c:\matlab-libs-win.zip"
Write-Output "Extract matlab libraries"
& 7z x -y "c:\matlab-libs-win.zip" -oC:\tixi-3rdparty\ > null
}
- name: Set up Visual Studio shell
if: startsWith(matrix.os, 'windows')
uses: egor-tensin/vs-shell@v2
with:
arch: x64
- name: Configure TiXI (MacOS, Linux)
if: startsWith(matrix.os, 'windows') == false
run: |
pixi r configure ${{ matrix.config }}
- name: Configure TiXI (Windows)
if: startsWith(matrix.os, 'windows')
run: |
pixi r configure ${{ matrix.config }} -DMATLAB_DIR=c:\tixi-3rdparty\matlab-libs-win
- name: Build TiXI
run: |
pixi r doc
pixi r install
- name: Upload build directory
uses: actions/upload-artifact@v6
with:
name: build-${{ matrix.os }}-${{ matrix.config }}
path: build
retention-days: 1
- name: Build conan package
if: ${{ github.event_name == 'schedule' && matrix.os == 'ubuntu-latest' && matrix.config == 'Release' }}
run: pixi r conan
test:
strategy:
matrix:
config: ["Debug", "Release"]
os: ["ubuntu-latest", "ubuntu-22.04", "windows-2022", "windows-latest"]
exclude:
- os: windows-2022
config: Debug
- os: windows-latest
config: Debug
runs-on: ${{ matrix.os }}
needs: build
steps:
- uses: actions/checkout@v6
with:
submodules: recursive
- name: Setup pixi
uses: prefix-dev/setup-pixi@v0.9.4
with:
cache: true
cache-write: ${{ github.event_name == 'push' && github.ref_name == 'main' }}
- name: Download build directory
uses: actions/download-artifact@v7
with:
name: build-${{ matrix.os }}-${{ matrix.config }}
path: build
- name: chmod unittests
if: startsWith(matrix.os, 'windows') == false
run:
chmod a+x build/tests/TIXI-unittests
- name: Run unit tests
run: |
pixi r test
deploy:
runs-on: "windows-2022"
needs: test
steps:
- uses: actions/checkout@v6
with:
submodules: recursive
- name: Setup pixi
uses: prefix-dev/setup-pixi@v0.9.4
with:
cache: true
cache-write: ${{ github.event_name == 'push' && github.ref_name == 'main' }}
- name: Download build directory
uses: actions/download-artifact@v7
with:
name: build-windows-2022-Release
path: build
- name: Artifact installer and zip
run: |
pixi r cpack
- name: Upload installer as artifact
uses: actions/upload-artifact@v6
with:
name: win64-installer
path: build/*.exe
- name: Upload package as artifact
uses: actions/upload-artifact@v6
with:
name: win64-package
path: build/*.zip
- name: Upload documentation as artifact
uses: actions/upload-artifact@v6
with:
name: html-documentation
path: build/doc/html/*