name: Native backend regression on: push: paths: - "app/**" - "native/**" - "schemas/**" - "tests/**" - "requirements*.txt" - "constraints/**" - ".python-version" - ".gitattributes" - ".github/workflows/solver-regression.yml" pull_request: paths: - "app/**" - "native/**" - "schemas/**" - "tests/**" - "requirements*.txt" - "constraints/**" - ".python-version" - ".gitattributes" - ".github/workflows/solver-regression.yml" schedule: - cron: "17 3 * * *" workflow_dispatch: concurrency: group: solver-regression-${{ github.ref }}-${{ github.event_name }} cancel-in-progress: false permissions: contents: read jobs: contracts: runs-on: ubuntu-24.04 timeout-minutes: 10 steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 with: python-version-file: .python-version cache: pip cache-dependency-path: constraints/python312-linux-x86_64.lock - name: Install backend runtime without numerical Python packages run: | python -m pip install -r constraints/python312-linux-x86_64.lock python -m pip check - name: Validate portable metadata and XML contracts env: SYSTEM_SIMULATION_VERIFY_LOCKED_ENV: "1" run: | python -W error::ResourceWarning -m unittest \ tests.test_dependency_constraints \ tests.test_regression_fixture_line_endings \ tests.test_component_catalog \ tests.test_component_metadata \ tests.test_component_registry \ tests.test_port_computation \ tests.test_native_schedule.DependencyGraphTests \ tests.test_medium_reference_contract \ tests.test_system_xml_v3 \ tests.test_native_only_backend native-linux: runs-on: ubuntu-24.04 timeout-minutes: 15 steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 with: python-version-file: .python-version - name: Install native dependencies with the existing Linux setup run: | python -m venv .venv .venv/bin/python -m pip install -r requirements-test.txt bash bat/setup-native-linux.sh - name: Check startup diagnostics, native cache and solver control on Linux env: SIMULATION_NATIVE_REQUIRE_TOOLCHAIN: "1" run: | .venv/bin/python -W error::ResourceWarning -m unittest \ tests.test_simulation_warmup tests.test_native_cache_platform \ tests.test_native_solver_control tests.test_native_worker_control \ tests.test_result_storage tests.test_native_sample_storage tests.test_native_result_transport -v native-windows: runs-on: windows-2022 timeout-minutes: 30 defaults: run: shell: pwsh steps: - uses: actions/checkout@v4 - uses: conda-incubator/setup-miniconda@v3 with: python-version: "3.12" activate-environment: simulation-native auto-activate-base: false - name: Install native compiler and SUNDIALS run: | conda install --yes -c conda-forge sundials=7.4.0 m2w64-gcc if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } "SUNDIALS_ROOT=$env:CONDA_PREFIX\Library" >> $env:GITHUB_ENV "SIMULATION_NATIVE_CC=$env:CONDA_PREFIX\Library\mingw-w64\bin\gcc.exe" >> $env:GITHUB_ENV python -m pip install -r requirements-test.txt python -m pip check - name: Verify native cache on the Windows runtime env: SIMULATION_NATIVE_REQUIRE_TOOLCHAIN: "1" run: | New-Item -ItemType Directory -Force test/ci-native-cache | Out-Null python -W error::ResourceWarning -m unittest tests.test_native_cache_storage tests.test_native_cache_platform -v > test/ci-native-cache/regression.log 2>&1 $cacheRegressionExit = $LASTEXITCODE Get-Content test/ci-native-cache/regression.log if ($cacheRegressionExit -ne 0) { exit $cacheRegressionExit } - name: Run catalog, numerical, API and schema regression run: | python -c "from app.simulation.native_codegen.build import toolchain; print(toolchain())" if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } python -W error::ResourceWarning -m unittest discover -s tests - name: Complete the 10 second skill fixture in native RK45 run: | python -m app.simulation.native_codegen tests/fixtures/native-skill-test.xml --output-dir test/ci-skill --method RK45 --max-step 0.001 --rtol 1e-7 --runs 1 --solve-only - if: always() uses: actions/upload-artifact@v4 with: name: native-skill-regression path: test/ci-skill/summary.json if-no-files-found: warn - if: always() uses: actions/upload-artifact@v4 with: name: native-windows-cache-regression path: test/ci-native-cache/regression.log if-no-files-found: warn