Improve bow tests #311
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build+Test | |
on: | |
push: | |
branches: | |
- '**' | |
tags: | |
- 'v[0-9]+.[0-9]+.[0-9]+' | |
jobs: | |
build-windows: | |
runs-on: windows-2022 | |
timeout-minutes: 30 | |
defaults: | |
run: | |
shell: bash | |
env: | |
RUSTFLAGS: -D warnings # Make Rust compiler fail on warnings | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
path: virtualbow | |
- name: Get dependencies | |
run: | | |
choco install ninja | |
curl -LO https://github.com/bow-simulation/virtualbow-dependencies/releases/download/v1.5.0/windows-mingw_64.zip && 7z x windows-mingw_64.zip | |
- name: Extract test files | |
run: | | |
cd virtualbow/rust/virtualbow/bows/examples | |
7z x examples.zip -p${{ secrets.UNZIP_PASSWORD }} | |
- name: Build and test solver | |
run: | | |
cd virtualbow/rust | |
cargo clippy --all-targets | |
cargo build --release | |
cargo test --release | |
- name: Build and test application | |
run: | | |
mkdir build && cd build | |
cmake ../virtualbow/gui -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=../windows-mingw_64/paths.cmake | |
cmake --build . -j4 | |
cmake --build . --target iss-installer -j4 | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: windows-application | |
path: build/application | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: windows-packages | |
path: build/packages | |
build-linux: | |
runs-on: ubuntu-20.04 | |
timeout-minutes: 30 | |
env: | |
RUSTFLAGS: -D warnings # Make Rust compiler fail on warnings | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
path: virtualbow | |
- name: Get dependencies | |
run: | | |
sudo apt install -y ninja-build qt5-default | |
curl -LO https://github.com/bow-simulation/virtualbow-dependencies/releases/download/v1.5.0/linux-gcc_64.zip && unzip linux-gcc_64.zip | |
- name: Extract test files | |
run: | | |
cd virtualbow/rust/virtualbow/bows/examples | |
7z x examples.zip -p${{ secrets.UNZIP_PASSWORD }} | |
- name: Build and test solver | |
run: | | |
cd virtualbow/rust | |
cargo clippy --all-targets | |
cargo build --release | |
cargo test --release | |
- name: Build and test application | |
run: | | |
mkdir build && cd build | |
cmake ../virtualbow/gui -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=../linux-gcc_64/paths.cmake | |
cmake --build . -j4 | |
cmake --build . --target deb-package -j4 | |
cmake --build . --target rpm-package -j4 | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: linux-application | |
path: build/application | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: linux-packages | |
path: build/packages | |
build-macos: | |
runs-on: macos-13 | |
timeout-minutes: 30 | |
env: | |
RUSTFLAGS: -D warnings # Make Rust compiler fail on warnings | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
path: virtualbow | |
- name: Get dependencies | |
run: | | |
brew install ninja | |
npm install -g [email protected] --no-audit | |
curl -LO https://github.com/bow-simulation/virtualbow-dependencies/releases/download/v1.5.0/macos-clang_64.zip && unzip macos-clang_64.zip | |
chmod -R 755 macos-clang_64 | |
- name: Extract test files | |
run: | | |
cd virtualbow/rust/virtualbow/bows/examples | |
7z x examples.zip -p${{ secrets.UNZIP_PASSWORD }} | |
- name: Build and test solver | |
run: | | |
cd virtualbow/rust | |
cargo clippy --all-targets | |
cargo build --release | |
cargo test --release | |
- name: Build and test application | |
run: | | |
mkdir build && cd build | |
cmake ../virtualbow/gui -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=../macos-clang_64/paths.cmake -DCMAKE_OSX_DEPLOYMENT_TARGET=10.13 | |
cmake --build . -j4 | |
cmake --build . --target dmg-installer -j4 | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: macos-application | |
path: build/application | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: macos-packages | |
path: build/packages | |
develop-release: | |
if: github.ref == 'refs/heads/develop' | |
runs-on: ubuntu-20.04 | |
needs: [build-windows, build-linux, build-macos] | |
steps: | |
- uses: actions/download-artifact@v4 | |
with: | |
name: windows-packages | |
- uses: actions/download-artifact@v4 | |
with: | |
name: linux-packages | |
- uses: actions/download-artifact@v4 | |
with: | |
name: macos-packages | |
- name: Rename packages | |
run: | | |
mv virtualbow-setup.exe virtualbow-${GITHUB_SHA::7}-win64.exe | |
mv virtualbow.deb virtualbow-${GITHUB_SHA::7}-linux64.deb | |
mv virtualbow.rpm virtualbow-${GITHUB_SHA::7}-linux64.rpm | |
mv virtualbow.dmg virtualbow-${GITHUB_SHA::7}-mac64.dmg | |
- name: Create release | |
uses: marvinpinto/[email protected] | |
with: | |
repo_token: ${{ secrets.RELEASE_TOKEN }} | |
automatic_release_tag: latest | |
prerelease: true | |
title: Development Build | |
files: virtualbow* | |
tagged-release: | |
if: startsWith(github.ref, 'refs/tags') | |
runs-on: ubuntu-20.04 | |
needs: [build-windows, build-linux, build-macos] | |
steps: | |
- uses: actions/download-artifact@v4 | |
with: | |
name: windows-packages | |
- uses: actions/download-artifact@v4 | |
with: | |
name: linux-packages | |
- uses: actions/download-artifact@v4 | |
with: | |
name: macos-packages | |
- name: Rename packages | |
run: | | |
mv virtualbow-setup.exe virtualbow-${{github.ref_name}}-win64.exe | |
mv virtualbow.deb virtualbow-${{github.ref_name}}-linux64.deb | |
mv virtualbow.rpm virtualbow-${{github.ref_name}}-linux64.rpm | |
mv virtualbow.dmg virtualbow-${{github.ref_name}}-mac64.dmg | |
- name: Create release | |
uses: marvinpinto/action-automatic-releases@latest | |
with: | |
repo_token: ${{ secrets.RELEASE_TOKEN }} | |
draft: true | |
files: virtualbow* |