Skip to content

Commit

Permalink
overhaul GHA script
Browse files Browse the repository at this point in the history
  • Loading branch information
ewu63 committed Jul 16, 2024
1 parent 5ac42f0 commit 1757c6e
Showing 1 changed file with 40 additions and 38 deletions.
78 changes: 40 additions & 38 deletions .github/windows.yaml
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 .

0 comments on commit 1757c6e

Please sign in to comment.