Skip to content

Commit 9eb0256

Browse files
authored
Merge pull request #272 from bow-simulation/integrate-new-solver
Integrate new Rust solver into the application
2 parents efa883c + 73926de commit 9eb0256

1,280 files changed

Lines changed: 70022 additions & 41428 deletions

File tree

Some content is hidden

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

.gitattributes

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
resources/* linguist-vendored
1+
resources/** linguist-vendored

.github/workflows/build.yml

Lines changed: 74 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,11 @@
1-
name: CI
1+
name: Build+Test
22

33
on:
44
push:
55
branches:
66
- '**'
77
tags:
88
- 'v[0-9]+.[0-9]+.[0-9]+'
9-
10-
pull_request:
11-
branches:
12-
- develop
139

1410
jobs:
1511
build-windows:
@@ -18,51 +14,86 @@ jobs:
1814
defaults:
1915
run:
2016
shell: cmd
17+
env:
18+
RUSTFLAGS: -D warnings # Make Rust compiler fail on warnings
2119
steps:
2220
- uses: actions/checkout@v4
2321
with:
24-
path: virtualbow
22+
path: virtualbow
23+
24+
- uses: TheMrMilchmann/setup-msvc-dev@v3 # Setup MSVC build environment
25+
with:
26+
arch: x64
2527

2628
- name: Get dependencies
2729
run: |
2830
choco install ninja
29-
curl -LO https://github.com/bow-simulation/virtualbow-dependencies/releases/download/v1.5.0/windows-mingw_64.zip && 7z x windows-mingw_64.zip
31+
curl -LO https://github.com/bow-simulation/virtualbow-dependencies/releases/download/v1.6.0/windows-msvc_64.zip && 7z x windows-msvc_64.zip
3032
31-
- name: Build and test
33+
- name: Extract test files
34+
run: |
35+
cd virtualbow/rust/virtualbow/data
36+
7z x examples.zip -p${{ secrets.UNZIP_PASSWORD }}
37+
38+
- name: Build and test solver
39+
run: |
40+
cd virtualbow/rust
41+
cargo clippy --all-targets
42+
cargo build --release
43+
cargo test --release
44+
45+
- name: Build and test application
3246
run: |
3347
mkdir build && cd build
34-
cmake ../virtualbow -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=../windows-mingw_64/paths.cmake
48+
cmake ../virtualbow/gui -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=../windows-msvc_64/paths.cmake
3549
cmake --build . -j4
3650
cmake --build . --target iss-installer -j4
37-
virtualbow-test
38-
51+
virtualbow-test.exe
52+
3953
- uses: actions/upload-artifact@v4
4054
with:
4155
name: windows-application
4256
path: build/application
43-
57+
if-no-files-found: error
58+
4459
- uses: actions/upload-artifact@v4
4560
with:
4661
name: windows-packages
4762
path: build/packages
63+
if-no-files-found: error
4864

4965
build-linux:
50-
runs-on: ubuntu-20.04
66+
runs-on: ubuntu-24.04
5167
timeout-minutes: 30
68+
env:
69+
RUSTFLAGS: -D warnings # Make Rust compiler fail on warnings
5270
steps:
5371
- uses: actions/checkout@v4
5472
with:
5573
path: virtualbow
5674

5775
- name: Get dependencies
5876
run: |
59-
sudo apt install -y ninja-build qt5-default
60-
curl -LO https://github.com/bow-simulation/virtualbow-dependencies/releases/download/v1.5.0/linux-gcc_64.zip && unzip linux-gcc_64.zip
77+
sudo apt update
78+
sudo apt install -y ninja-build qt6-base-dev pkg-config libfreetype6-dev libfontconfig1-dev
79+
curl -LO https://github.com/bow-simulation/virtualbow-dependencies/releases/download/v1.6.0/linux-gcc_64.zip && unzip linux-gcc_64.zip
80+
81+
- name: Extract test files
82+
run: |
83+
cd virtualbow/rust/virtualbow/data
84+
7z x examples.zip -p${{ secrets.UNZIP_PASSWORD }}
6185
62-
- name: Build and test
86+
- name: Build and test solver
87+
run: |
88+
cd virtualbow/rust
89+
cargo clippy --all-targets
90+
cargo build --release
91+
cargo test --release
92+
93+
- name: Build and test application
6394
run: |
6495
mkdir build && cd build
65-
cmake ../virtualbow -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=../linux-gcc_64/paths.cmake
96+
cmake ../virtualbow/gui -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=../linux-gcc_64/paths.cmake
6697
cmake --build . -j4
6798
cmake --build . --target deb-package -j4
6899
cmake --build . --target rpm-package -j4
@@ -72,51 +103,65 @@ jobs:
72103
with:
73104
name: linux-application
74105
path: build/application
106+
if-no-files-found: error
75107

76108
- uses: actions/upload-artifact@v4
77109
with:
78110
name: linux-packages
79111
path: build/packages
112+
if-no-files-found: error
80113

81114
build-macos:
82-
runs-on: macos-12
115+
runs-on: macos-13
83116
timeout-minutes: 30
117+
env:
118+
RUSTFLAGS: -D warnings # Make Rust compiler fail on warnings
84119
steps:
85120
- uses: actions/checkout@v4
86121
with:
87122
path: virtualbow
88123

89124
- name: Get dependencies
90125
run: |
91-
brew install ninja
92126
npm install -g appdmg@0.6.0 --no-audit
93-
curl -LO https://github.com/bow-simulation/virtualbow-dependencies/releases/download/v1.5.0/macos-clang_64.zip && unzip macos-clang_64.zip
127+
curl -LO https://github.com/bow-simulation/virtualbow-dependencies/releases/download/v1.6.0/macos-clang_64.zip && unzip macos-clang_64.zip
94128
chmod -R 755 macos-clang_64
129+
130+
- name: Extract test files
131+
run: |
132+
cd virtualbow/rust/virtualbow/data
133+
7z x examples.zip -p${{ secrets.UNZIP_PASSWORD }}
134+
135+
- name: Build and test solver
136+
run: |
137+
cd virtualbow/rust
138+
cargo clippy --all-targets
139+
cargo build --release
140+
cargo test --release
95141
96-
- name: Build and test
142+
- name: Build and test application
97143
run: |
98144
mkdir build && cd build
99-
cmake ../virtualbow -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=../macos-clang_64/paths.cmake -DCMAKE_OSX_DEPLOYMENT_TARGET=10.13
145+
cmake ../virtualbow/gui -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=../macos-clang_64/paths.cmake -DCMAKE_OSX_DEPLOYMENT_TARGET=10.15
100146
cmake --build . -j4
101147
cmake --build . --target dmg-installer -j4
102148
./virtualbow-test
103-
104-
- name: Display file structure
105-
run: ls -R
106-
149+
107150
- uses: actions/upload-artifact@v4
108151
with:
109152
name: macos-application
110153
path: build/application
154+
if-no-files-found: error
111155

112156
- uses: actions/upload-artifact@v4
113157
with:
114158
name: macos-packages
115159
path: build/packages
160+
if-no-files-found: error
116161

117162
develop-release:
118163
if: github.ref == 'refs/heads/develop'
119-
runs-on: ubuntu-20.04
164+
runs-on: ubuntu-latest
120165
needs: [build-windows, build-linux, build-macos]
121166
steps:
122167
- uses: actions/download-artifact@v4
@@ -144,10 +189,10 @@ jobs:
144189
prerelease: true
145190
title: Development Build
146191
files: virtualbow*
147-
192+
148193
tagged-release:
149194
if: startsWith(github.ref, 'refs/tags')
150-
runs-on: ubuntu-20.04
195+
runs-on: ubuntu-latest
151196
needs: [build-windows, build-linux, build-macos]
152197
steps:
153198
- uses: actions/download-artifact@v4

.github/workflows/coverage.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Coverage
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- develop
7+
8+
jobs:
9+
code-coverage:
10+
runs-on: ubuntu-latest
11+
timeout-minutes: 30
12+
steps:
13+
- uses: actions/checkout@v4
14+
15+
- name: Install system dependencies
16+
run: sudo apt-get update && sudo apt-get install -y libfontconfig1-dev
17+
18+
- name: Install cargo-llvm-cov
19+
uses: taiki-e/install-action@cargo-llvm-cov
20+
21+
- name: Extract test files
22+
run: |
23+
cd rust/virtualbow/data
24+
7z x examples.zip -p${{ secrets.UNZIP_PASSWORD }}
25+
26+
- name: Generate code coverage for solver tests
27+
run: |
28+
cd rust/virtualbow
29+
rustup default nightly
30+
cargo llvm-cov --release --branch --no-report
31+
cargo llvm-cov report --release --html --output-dir "."
32+
cargo llvm-cov report --release --text --output-dir "."
33+
34+
- name: Upload coverage report artifact
35+
id: artifact-upload-step
36+
uses: actions/upload-artifact@v4
37+
with:
38+
name: coverage-report
39+
path: rust/virtualbow/html
40+
41+
- name: Create report summary file
42+
run: |
43+
echo "# Coverage Report for ${GITHUB_SHA::7}" >> summary.md
44+
echo "This is an automatic summary of the test coverage results for the latest commit on this pull request." >> summary.md
45+
echo "The full report can be downloaded [here](${{ steps.artifact-upload-step.outputs.artifact-url }})." >> summary.md
46+
echo '```' >> summary.md
47+
echo "$(<rust/virtualbow/text/index.txt)" >> summary.md
48+
echo '```' >> summary.md
49+
50+
- name: Add summary as a pull request comment
51+
uses: marocchino/sticky-pull-request-comment@v2
52+
with:
53+
recreate: true
54+
path: summary.md

.gitignore

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
# Qt creator
22
*.user
3+
build
4+
5+
# VS Code
6+
.vscode
37

48
# Visual Studio
59
CMakeSettings.json
610
.vs/
711
out/
812

9-
# VirtualBow
10-
*.res
11-
1213
# MacOS
13-
.DS_Store
14+
.DS_Store

0 commit comments

Comments
 (0)