Dramatically optimize integrator tests for ultra-fast execution #10
This file contains hidden or 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: Tests | |
| on: | |
| push: | |
| branches: [ main, develop ] | |
| paths: | |
| - 'include/**' | |
| - 'test/**' | |
| - 'examples/**' | |
| - 'xmake.lua' | |
| - '.github/workflows/tests.yml' | |
| pull_request: | |
| branches: [ main ] | |
| paths: | |
| - 'include/**' | |
| - 'test/**' | |
| - 'examples/**' | |
| - 'xmake.lua' | |
| - '.github/workflows/tests.yml' | |
| jobs: | |
| test-linux: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| compiler: [gcc, clang] | |
| include: | |
| - compiler: gcc | |
| cc: gcc-11 | |
| cxx: g++-11 | |
| - compiler: clang | |
| cc: clang-15 | |
| cxx: clang++-15 | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Install system dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y build-essential cmake | |
| sudo apt-get install -y gcc-11 g++-11 clang-15 clang++-15 | |
| sudo apt-get install -y libeigen3-dev | |
| - name: Install xmake | |
| run: | | |
| curl -fsSL https://xmake.io/shget.text | bash | |
| echo "$HOME/.local/bin" >> $GITHUB_PATH | |
| - name: Configure xmake | |
| run: | | |
| xmake config --toolchain=${{ matrix.compiler }} --cc=${{ matrix.cc }} --cxx=${{ matrix.cxx }} --yes | |
| - name: Build tests | |
| run: | | |
| xmake build -g tests | |
| xmake build -g integration_tests | |
| - name: Run unit tests | |
| run: | | |
| xmake run test_state_concept | |
| xmake run test_rk4_integrator | |
| xmake run test_advanced_integrators | |
| xmake run test_dop853 | |
| - name: Run integration tests | |
| run: | | |
| xmake run test_sde_solvers | |
| xmake run test_sde_integration | |
| xmake run test_modernized_interface | |
| xmake run test_standard_parallelism | |
| - name: Run comprehensive test suite | |
| run: | | |
| xmake test-all --verbose | |
| test-windows: | |
| runs-on: windows-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup MSVC | |
| uses: ilammy/msvc-dev-cmd@v1 | |
| - name: Install xmake | |
| run: | | |
| Invoke-Expression (Invoke-Webrequest 'https://xmake.io/psget.text' -UseBasicParsing).Content | |
| - name: Refresh PATH and verify xmake | |
| run: | | |
| $env:PATH = [System.Environment]::GetEnvironmentVariable("PATH","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("PATH","User") | |
| xmake --version | |
| - name: Configure xmake | |
| run: | | |
| $env:PATH = [System.Environment]::GetEnvironmentVariable("PATH","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("PATH","User") | |
| xmake config --toolchain=msvc --arch=x64 --yes | |
| - name: Build tests | |
| run: | | |
| $env:PATH = [System.Environment]::GetEnvironmentVariable("PATH","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("PATH","User") | |
| xmake build -g tests | |
| xmake build -g integration_tests | |
| - name: Run unit tests | |
| run: | | |
| $env:PATH = [System.Environment]::GetEnvironmentVariable("PATH","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("PATH","User") | |
| xmake run test_state_concept | |
| xmake run test_rk4_integrator | |
| xmake run test_advanced_integrators | |
| xmake run test_dop853 | |
| - name: Run integration tests | |
| run: | | |
| $env:PATH = [System.Environment]::GetEnvironmentVariable("PATH","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("PATH","User") | |
| xmake run test_sde_solvers | |
| xmake run test_sde_integration | |
| xmake run test_modernized_interface | |
| xmake run test_standard_parallelism | |
| - name: Run comprehensive test suite | |
| run: | | |
| $env:PATH = [System.Environment]::GetEnvironmentVariable("PATH","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("PATH","User") | |
| xmake test-all --verbose | |
| test-macos: | |
| runs-on: macos-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Install system dependencies | |
| run: | | |
| brew install eigen | |
| - name: Install xmake | |
| run: | | |
| curl -fsSL https://xmake.io/shget.text | bash | |
| echo "$HOME/.local/bin" >> $GITHUB_PATH | |
| - name: Configure xmake | |
| run: | | |
| xmake config --toolchain=clang --yes | |
| - name: Build tests | |
| run: | | |
| xmake build -g tests | |
| xmake build -g integration_tests | |
| - name: Run unit tests | |
| run: | | |
| xmake run test_state_concept | |
| xmake run test_rk4_integrator | |
| xmake run test_advanced_integrators | |
| xmake run test_dop853 | |
| - name: Run integration tests | |
| run: | | |
| xmake run test_sde_solvers | |
| xmake run test_sde_integration | |
| xmake run test_modernized_interface | |
| xmake run test_standard_parallelism | |
| - name: Run comprehensive test suite | |
| run: | | |
| xmake test-all --verbose | |
| test-examples: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Install system dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y build-essential cmake | |
| sudo apt-get install -y gcc-11 g++-11 | |
| sudo apt-get install -y libeigen3-dev | |
| - name: Install xmake | |
| run: | | |
| curl -fsSL https://xmake.io/shget.text | bash | |
| echo "$HOME/.local/bin" >> $GITHUB_PATH | |
| - name: Configure xmake | |
| run: | | |
| xmake config --toolchain=gcc --cc=gcc-11 --cxx=g++-11 --yes | |
| - name: Build examples | |
| run: | | |
| xmake build -g examples | |
| - name: Run examples | |
| run: | | |
| xmake run state_concept_usage | |
| xmake run rk4_integrator_usage | |
| xmake run advanced_integrators_usage | |
| xmake run quick_test | |
| xmake run sde_demo | |
| xmake run parallelism_usage_demo | |
| xmake run sde_usage_demo | |
| xmake run standard_parallelism_demo | |
| xmake run working_integrators_demo | |
| xmake run simple_standard_parallelism | |
| xmake run simplified_parallel_usage | |
| performance-test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Install system dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y build-essential cmake | |
| sudo apt-get install -y gcc-11 g++-11 | |
| sudo apt-get install -y libeigen3-dev | |
| - name: Install xmake | |
| run: | | |
| curl -fsSL https://xmake.io/shget.text | bash | |
| echo "$HOME/.local/bin" >> $GITHUB_PATH | |
| - name: Configure xmake for performance | |
| run: | | |
| xmake config --toolchain=gcc --cc=gcc-11 --cxx=g++-11 --mode=release --yes | |
| - name: Build performance tests | |
| run: | | |
| xmake build -g performance | |
| - name: Run performance benchmarks | |
| run: | | |
| xmake run performance_benchmark | |
| - name: Upload performance results | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: performance-results | |
| path: performance_results.txt | |
| retention-days: 30 | |
| if: always() | |
| test-coverage: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Install system dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y build-essential cmake | |
| sudo apt-get install -y gcc-11 g++-11 | |
| sudo apt-get install -y libeigen3-dev | |
| sudo apt-get install -y lcov | |
| - name: Install xmake | |
| run: | | |
| curl -fsSL https://xmake.io/shget.text | bash | |
| echo "$HOME/.local/bin" >> $GITHUB_PATH | |
| - name: Configure xmake with coverage | |
| run: | | |
| xmake config --toolchain=gcc --cc=gcc-11 --cxx=g++-11 --mode=debug --yes | |
| - name: Build and run tests with coverage | |
| run: | | |
| xmake build -g tests | |
| xmake build -g integration_tests | |
| xmake test-all --verbose | |
| - name: Generate coverage report | |
| run: | | |
| # Create a simple coverage report since we don't have actual coverage flags set | |
| echo "Coverage report placeholder" > coverage.info | |
| - name: Upload coverage reports | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: coverage-report | |
| path: coverage.info | |
| retention-days: 30 | |
| if: always() |