From ed3706cf80ca74035e630ac3d385c7ab400fa11b Mon Sep 17 00:00:00 2001 From: "Corey R. Randall" Date: Mon, 23 Dec 2024 11:39:35 -0700 Subject: [PATCH] Add windows build/tests to test-sundials CI --- .github/workflows/test-sundials.yml | 58 +++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) diff --git a/.github/workflows/test-sundials.yml b/.github/workflows/test-sundials.yml index aa0b8ad..b6acae0 100644 --- a/.github/workflows/test-sundials.yml +++ b/.github/workflows/test-sundials.yml @@ -127,3 +127,61 @@ jobs: tox env: TOXENV: ${{ matrix.tox-env }} + + test-windows: + name: (Test ${{ matrix.python-version }}, ${{ matrix.os }}) + runs-on: ${{ matrix.os }} + + strategy: + matrix: + os: [macos-latest, windows-latest] # set more OS here, if desired + python-version: ["3.9", "3.13"] # set more python versions here, if desired + + defaults: + run: + shell: bash -l {0} + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Setup conda/python + uses: conda-incubator/setup-miniconda@v3 + with: + auto-update-conda: true + miniconda-version: latest + activate-environment: odes + python-version: ${{ matrix.python-version }} + + - name: Setup SUNDIALS + run: conda install sundials=7.1.1 -c conda-forge # SUNDIALS version is set here + + - name: Verify environment + run: | + conda info + conda list + + - name: Set SUNDIALS installation path + run: | + if [[ "$RUNNER_OS" == "Windows" ]]; then + echo "SUNDIALS_INST=%CONDA_PREFIX%/Library" >> $GITHUB_ENV + else + echo "SUNDIALS_INST=$CONDA_PREFIX" >> $GITHUB_ENV + fi + + - name: Install scikits-odes-sundials + working-directory: packages/scikits-odes-sundials + run: | + python -m pip install --upgrade pip + pip install . + + - name: List info + run: | + conda info + conda list + + - name: Run tests + working-directory: packages/scikits-odes-sundials/src/scikits_odes_sundials + run: | + pip install pytest + pytest .