forked from simbody/simbody
-
Notifications
You must be signed in to change notification settings - Fork 0
171 lines (132 loc) · 5.98 KB
/
Copy pathcontinuous_integration.yml
File metadata and controls
171 lines (132 loc) · 5.98 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
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
name: continuous-integration
# syntax https://help.github.com/en/articles/workflow-syntax-for-github-actions
on:
pull_request:
branches:
- '*'
push:
branches:
- master
tags:
- '*'
jobs:
windows:
name: Windows
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Install Doxygen
# choco install doxygen.portable # <-- too unreliable.
run: |
(New-Object System.Net.WebClient).DownloadFile("https://github.com/doxygen/doxygen/releases/download/Release_1_12_0/doxygen-1.12.0.windows.x64.bin.zip", "doxygen.zip")
7z x $env:GITHUB_WORKSPACE/doxygen.zip -odoxygen
echo "$env:GITHUB_WORKSPACE\\doxygen" >> $GITHUB_PATH
- name: Obtain short git commit hash
id: commithash
shell: bash
# https://stackoverflow.com/questions/58886293/getting-current-branch-and-commit-hash-in-github-action
run: echo "::set-output name=hash::$(git rev-parse --short HEAD)"
- name: Configure
run: |
cmake -S $env:GITHUB_WORKSPACE --preset ci-msvc-windows-release -LAH
- name: Build
run: |
cmake --build --preset ci-msvc-windows-release --parallel 4
- name: Test
run: |
ctest --preset ci-msvc-windows-release --parallel 4
- name: Install
run: |
cmake --build --preset ci-msvc-windows-release --config Release --parallel 4 --target doxygen
cmake --install $env:GITHUB_WORKSPACE\\out\\build\\ci-msvc-windows-release --config Release
move $env:GITHUB_WORKSPACE\\out\\install\\ci-msvc-windows-release simbody-${{ steps.commithash.outputs.hash }}
- name: Upload
uses: actions/upload-artifact@v4
with:
name: simbody-${{ steps.commithash.outputs.hash }}-win
path: simbody-${{ steps.commithash.outputs.hash }}
mac:
name: Mac
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: Install Homebrew packages
run: |
brew install doxygen
- name: Obtain short git commit hash
id: commithash
shell: bash
run: echo "::set-output name=hash::$(git rev-parse --short HEAD)"
- name: Configure
run: |
cmake -S $GITHUB_WORKSPACE --preset ci-make-macos-release -LAH
- name: Build
run: |
cmake --build --preset ci-make-macos-release --parallel 4
- name: Test
run: |
ctest --preset ci-make-macos-release --parallel 4
- name: Install
run: |
cmake --build --preset ci-make-macos-release --target doxygen
cmake --install $GITHUB_WORKSPACE/out/build/ci-make-macos-release
mv $GITHUB_WORKSPACE/out/install/ci-make-macos-release simbody-${{ steps.commithash.outputs.hash }}
zip --symlinks --recurse-paths --quiet simbody-${{ steps.commithash.outputs.hash }}.zip simbody-${{ steps.commithash.outputs.hash }}
- name: Upload
uses: actions/upload-artifact@v4
with:
# The upload-artifact zipping does not preserve symlinks or executable
# bits. So we zip ourselves, even though this causes a double-zip.
name: simbody-${{ steps.commithash.outputs.hash }}-mac
path: simbody-${{ steps.commithash.outputs.hash }}.zip
ubuntu:
name: Ubuntu
runs-on: ubuntu-22.04
strategy:
matrix:
build_type: [release, debug]
compiler: [gcc, clang]
steps:
- uses: actions/checkout@v4
- name: Obtain short git commit hash
id: commithash
shell: bash
run: echo "::set-output name=hash::$(git rev-parse --short HEAD)"
- name: Install packages
run: sudo apt-get install --yes liblapack-dev freeglut3-dev libxi-dev libxmu-dev doxygen
- name: Configure
run: |
cmake -S $GITHUB_WORKSPACE --preset ci-make-${{ matrix.compiler }}-linux-${{ matrix.build_type }} -LAH
- name: Build
run: |
cmake --build --preset ci-make-${{ matrix.compiler }}-linux-${{ matrix.build_type }} --parallel 4
- name: Test
run: |
ctest --preset ci-make-${{ matrix.compiler }}-linux-${{ matrix.build_type }} --output-on-failure
- name: Install
run: |
cmake --build --preset ci-make-${{ matrix.compiler }}-linux-${{ matrix.build_type }} --target doxygen
cmake --install $GITHUB_WORKSPACE/out/build/ci-make-${{ matrix.compiler }}-linux-${{ matrix.build_type }}
mv $GITHUB_WORKSPACE/out/install/ci-make-${{ matrix.compiler }}-linux-${{ matrix.build_type }} simbody-${{ steps.commithash.outputs.hash }}
zip --symlinks --recurse-paths --quiet simbody-${{ steps.commithash.outputs.hash }}.zip simbody-${{ steps.commithash.outputs.hash }}
- name: Upload
uses: actions/upload-artifact@v4
with:
# The upload-artifact zipping does not preserve symlinks or executable
# bits. So we zip ourselves, even though this causes a double-zip.
name: simbody-${{ steps.commithash.outputs.hash }}-linux-${{ matrix.compiler }}-${{ matrix.build_type }}
path: simbody-${{ steps.commithash.outputs.hash }}.zip
style:
name: Style
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Check for tabs
# Ensure that there are no tabs in source code.
# GREP returns 0 (true) if there are any matches, and
# we don't want any matches. If there are matches,
# print a helpful message, and make the test fail by using "false".
# The GREP command here checks for any tab characters in the the files
# that match the specified pattern. GREP does not pick up explicit tabs
# (e.g., literally a \t in a source file).
run: if grep --recursive --include={*.cpp,*.c,*.h,*.md,*.yml,*.cmake.*.xml,*.html,*.in,*.txt} --exclude-dir=c-cmaes -P "\t" . ; then echo "Tabs found in the lines shown above. See CONTRIBUTING.md about tabs."; false; else echo "Repo passed no-tabs check."; fi