diff --git a/.github/windows.yaml b/.github/windows.yaml index baa25032..a947b3b3 100644 --- a/.github/windows.yaml +++ b/.github/windows.yaml @@ -1,46 +1,48 @@ -trigger: - - main +name: Windows pyOptSparse Test -pr: - - main +on: + push: + branches: + - main + pull_request: + branches: + - main jobs: - - pyoptsparse-test: + pyoptsparse-test: + name: Test pyOptSparse on Windows runs-on: windows-latest strategy: + fail-fast: false matrix: numpy_version: ["1.21.6", "1.25.2", "2.0.0"] steps: - - powershell: Write-Host "##vso[task.prependpath]$env:CONDA\Scripts" - displayName: Add conda to PATH - - - script: conda config --add channels conda-forge && conda config --set channel_priority strict - displayName: Set channel priority - - - script: conda create --yes --name pyos-build - displayName: Create environment - - - script: | - call activate pyos-build - call conda install -y mamba - call mamba env update --file .github/environment.yml - call mamba install -y libpgmath - displayName: Install mamba and update environment - - - script: | - set IPOPT_DIR=%CONDA_PREFIX%\Library - set CC=cl - set FC=flang - set CC_LD=link - python -m build -n -x . - pip install --no-deps --no-index --find-links dist pyoptsparse - displayName: Build and install pyoptsparse - - - script: | - call mamba install -y numpy==${{ matrix.numpy_version }} - displayName: Install runtime numpy - - - script: | - cd tests - testflo -n 1 . - displayName: Run tests + - uses: conda-incubator/setup-miniconda@v3 + with: + auto-update-conda: true + python-version: 3.10 + channels: conda-forge + channel-priority: strict + activate-environment: pyos-build + environment-file: .github/environment.yml + + - name: Install dependencies + run: | + conda install -y libpgmath + + - name: Build and install pyoptsparse + run: | + set CC=cl + set FC=flang + set CC_LD=link + python -m build -n -x . + pip install --no-deps --no-index --find-links dist pyoptsparse + + - name: Install runtime numpy + run: | + conda install -y numpy==${{ matrix.numpy_version }} + + - name: Run tests + run: | + cd tests + testflo -n 1 .