Skip to content

Commit cf40934

Browse files
authored
Merge pull request #174 from Virtonomy/feature/buildsystem-rework
Feature/buildsystem rework
2 parents fc1c544 + 43be82e commit cf40934

File tree

120 files changed

+1611
-3520
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

120 files changed

+1611
-3520
lines changed

.github/workflows/ci.yml

Lines changed: 145 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -7,56 +7,72 @@ on:
77
branches: [ master ]
88
pull_request:
99
branches: [ master ]
10-
1110
# Allows you to run this workflow manually from the Actions tab
1211
workflow_dispatch:
1312

14-
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
13+
env:
14+
VCPKG_VERSION: "2022.11.14"
15+
CTEST_PARALLEL_LEVEL: "1"
16+
17+
# A workflow is made up of one or more jobs that can run sequentially or in parallel
1518
jobs:
16-
# This workflow contains a single job called "build"
17-
build:
18-
# The type of runner that the job will run on
19+
20+
###############################################################################
21+
22+
Linux:
1923
runs-on: ubuntu-20.04
20-
# Steps represent a sequence of tasks that will be executed as part of the job
24+
env:
25+
VCPKG_DEFAULT_TRIPLET: x64-linux
26+
2127
steps:
2228
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
23-
- uses: actions/checkout@v2
24-
25-
- uses: mstachniuk/ci-skip@v1
26-
27-
# Runs a set of commands using the runners shell
29+
- uses: actions/checkout@v3
30+
31+
- name: Install system dependencies
32+
run: |
33+
sudo apt update
34+
sudo apt install -y \
35+
apt-utils \
36+
build-essential \
37+
curl zip unzip tar `# when starting fresh on a WSL image for bootstrapping vcpkg`\
38+
pkg-config `# for installing libraries with vcpkg`\
39+
git \
40+
cmake \
41+
ninja-build \
42+
python3
43+
44+
- uses: hendrikmuhs/[email protected]
45+
with:
46+
key: ${{ github.job }}
47+
48+
- uses: friendlyanon/setup-vcpkg@v1 # Setup vcpkg into ${{github.workspace}}
49+
with:
50+
committish: ${{ env.VCPKG_VERSION }}
51+
52+
- name: Install dependencies
53+
run: |
54+
${{github.workspace}}/vcpkg/vcpkg install --clean-after-build \
55+
eigen3 \
56+
tbb \
57+
boost-program-options \
58+
boost-geometry \
59+
simbody \
60+
gtest
61+
62+
- name: Generate buildsystem
63+
run: |
64+
cmake -G Ninja \
65+
-D CMAKE_BUILD_TYPE=Release \
66+
-D CMAKE_TOOLCHAIN_FILE="${{github.workspace}}/vcpkg/scripts/buildsystems/vcpkg.cmake" \
67+
-D CMAKE_C_COMPILER_LAUNCHER=ccache -D CMAKE_CXX_COMPILER_LAUNCHER=ccache \
68+
-S ${{github.workspace}} \
69+
-B ${{github.workspace}}/build
70+
2871
- name: Build
29-
if: ${{ env.CI_SKIP == 'false' }}
30-
run: |
31-
echo "This step should not be executed when commit message contains [ci skip]"
32-
sudo apt-get update
33-
sudo apt-get install -y apt-utils \
34-
build-essential \
35-
cmake \
36-
libgtest-dev \
37-
libtbb-dev \
38-
libboost-all-dev \
39-
libeigen3-dev \
40-
liblapack-dev \
41-
wget \
42-
unzip
43-
cd /home/runner/ && wget "https://github.com/Virtonomy/simbody/releases/download/Simbody-3.7.1/simbody_v3.7.1.zip"
44-
unzip "simbody_v3.7.1.zip"
45-
export TBB_HOME=/usr/lib/x86_64-linux-gnu
46-
export BOOST_HOME=/usr/lib/x86_64-linux-gnu
47-
cd /usr/src/gtest
48-
sudo cmake CMakeLists.txt
49-
sudo make -j$(nproc)
50-
cd /home/runner/work/SPHinXsys/SPHinXsys
51-
git submodule update --init
52-
mkdir build
53-
cd build
54-
cmake .. -DCMAKE_BUILD_TYPE=Release -DSIMBODY_HOME=/home/runner/simbody
55-
make -j$(nproc)
72+
run: cmake --build build --config Release --verbose
5673

5774
- name: Test with the first try
5875
id: first-try
59-
if: ${{ env.CI_SKIP == 'false' }}
6076
run: |
6177
cd /home/runner/work/SPHinXsys/SPHinXsys
6278
cd build
@@ -65,35 +81,117 @@ jobs:
6581

6682
- name: Test with the second try for failed cases
6783
id: second-try
68-
if: ${{ env.CI_SKIP == 'false' && steps.first-try.outcome == 'failure' }}
84+
if: ${{ steps.first-try.outcome == 'failure' }}
6985
run: |
70-
cd /home/runner/work/SPHinXsys/SPHinXsys
7186
cd build
7287
ctest --rerun-failed --output-on-failure
7388
continue-on-error: true
7489

7590
- name: Test with the third try for failed cases
7691
id: third-try
77-
if: ${{ env.CI_SKIP == 'false' && steps.second-try.outcome == 'failure' }}
92+
if: ${{ steps.second-try.outcome == 'failure' }}
7893
run: |
79-
cd /home/runner/work/SPHinXsys/SPHinXsys
8094
cd build
8195
ctest --rerun-failed --output-on-failure
8296
continue-on-error: true
8397

8498
- name: Test with the fourth try for failed cases
8599
id: fourth-try
86-
if: ${{ env.CI_SKIP == 'false' && steps.third-try.outcome == 'failure' }}
100+
if: ${{ steps.third-try.outcome == 'failure' }}
87101
run: |
88-
cd /home/runner/work/SPHinXsys/SPHinXsys
89102
cd build
90103
ctest --rerun-failed --output-on-failure
91104
continue-on-error: true
92105

93106
- name: Test with the last try for failed cases
94-
if: ${{ env.CI_SKIP == 'false' && steps.fourth-try.outcome == 'failure' }}
107+
if: ${{ steps.fourth-try.outcome == 'failure' }}
95108
run: |
96-
cd /home/runner/work/SPHinXsys/SPHinXsys
97109
cd build
98110
ctest --rerun-failed --output-on-failure
99111
112+
###############################################################################
113+
114+
Windows:
115+
runs-on: windows-latest
116+
env:
117+
VCPKG_DEFAULT_TRIPLET: x64-windows
118+
119+
steps:
120+
- uses: actions/checkout@v3 # Checks-out the repository under ${{github.workspace}}
121+
122+
- name: Update ccache and ninja # For correct caching with ccache on Windows
123+
shell: bash
124+
run: |
125+
choco install ccache
126+
choco install ninja
127+
128+
- uses: hendrikmuhs/[email protected]
129+
with:
130+
key: ${{ github.job }}
131+
132+
- uses: actions/setup-python@v4
133+
134+
- uses: friendlyanon/setup-vcpkg@v1 # Setup vcpkg into ${{github.workspace}}
135+
with:
136+
committish: ${{ env.VCPKG_VERSION }}
137+
138+
- name: Install dependencies
139+
run: |
140+
${{github.workspace}}\vcpkg\vcpkg.exe install --clean-after-build `
141+
eigen3 `
142+
tbb `
143+
boost-program-options `
144+
boost-geometry `
145+
simbody `
146+
gtest
147+
148+
- uses: ilammy/msvc-dev-cmd@v1
149+
150+
- name: Generate buildsystem
151+
run: |
152+
cmake.exe -G Ninja `
153+
-D CMAKE_BUILD_TYPE=Release `
154+
-D CMAKE_TOOLCHAIN_FILE="${{github.workspace}}\vcpkg\scripts\buildsystems\vcpkg.cmake" `
155+
-D CMAKE_C_COMPILER_LAUNCHER=ccache -D CMAKE_CXX_COMPILER_LAUNCHER=ccache `
156+
-S ${{github.workspace}} `
157+
-B C:\build
158+
159+
- name: Build
160+
run: cmake.exe --build C:\build --config Release --verbose
161+
162+
- name: Test with the first try
163+
id: first-try
164+
run: |
165+
cd C:\build
166+
ctest.exe --output-on-failure
167+
continue-on-error: true
168+
169+
- name: Test with the second try for failed cases
170+
id: second-try
171+
if: ${{ steps.first-try.outcome == 'failure' }}
172+
run: |
173+
cd C:\build
174+
ctest.exe --rerun-failed --output-on-failure
175+
continue-on-error: true
176+
177+
- name: Test with the third try for failed cases
178+
id: third-try
179+
if: ${{ steps.second-try.outcome == 'failure' }}
180+
run: |
181+
cd C:\build
182+
ctest.exe --rerun-failed --output-on-failure
183+
continue-on-error: true
184+
185+
- name: Test with the fourth try for failed cases
186+
id: fourth-try
187+
if: ${{ steps.third-try.outcome == 'failure' }}
188+
run: |
189+
cd C:\build
190+
ctest.exe --rerun-failed --output-on-failure
191+
continue-on-error: true
192+
193+
- name: Test with the last try for failed cases
194+
if: ${{ steps.fourth-try.outcome == 'failure' }}
195+
run: |
196+
cd C:\build
197+
ctest.exe --rerun-failed --output-on-failure

0 commit comments

Comments
 (0)