-
Notifications
You must be signed in to change notification settings - Fork 109
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
40 additions
and
38 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 . |