Skip to content

Commit

Permalink
Fixed the pipeline (#272)
Browse files Browse the repository at this point in the history
* Update test_unit_and_examples.yml
* Removed S4 build for macO x86
* Bring back the phoebe S4
* Dependecies does not work on MacOs < 3.10
---------
Co-authored-by: Luigi Giugliano <luigi.giugliano@pepsico.com>
  • Loading branch information
Abelarm committed Apr 2, 2024
1 parent 5ea496c commit 2bbb6f6
Showing 1 changed file with 95 additions and 25 deletions.
120 changes: 95 additions & 25 deletions .github/workflows/test_unit_and_examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,28 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
os: [ubuntu-latest, macos-13, windows-latest, macos-14]
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
exclude:
- os: macos-14
python-version: 3.7
- os: macos-14
python-version: 3.8
- os: macos-14
python-version: 3.9
- os: macos-13
python-version: 3.7
- os: macos-13
python-version: 3.8
- os: macos-13
python-version: 3.9

steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

Expand All @@ -42,9 +55,10 @@ jobs:
sudo apt install -y gfortran ngspice python3-tk libboost-all-dev libopenblas-dev libfftw3-dev libsuitesparse-dev
- name: Install system dependencies in MacOS
if: matrix.os == 'macos-latest'
if: >-
( contains(matrix.os, 'macos') )
run: |
brew reinstall gfortran
brew reinstall gfortran openblas pkg-config
brew install ngspice boost suite-sparse
- name: Install system dependencies in Windows
Expand All @@ -53,19 +67,42 @@ jobs:

- name: Install Python dependecies
run: |
pip install --upgrade pip
pip install numpy --config-settings=setup-args="-Dallow-noblas=true"
pip install pytest meson-python ninja cython spin
python3 -m spin install-dependencies -test-dep
- name: Install S4
if: matrix.os != 'windows-latest'
# - name: Install S4 (macOS - x86)
# if: matrix.os == 'macos-13'
# run: |
# pip install wheel setuptools
# git clone https://github.com/phoebe-p/S4
# cd S4
# make S4_pyext --file="Makefile.mac_intel"
# cd ..
# rm -rf S4

- name: Install S4 (macOS - arm)
if: matrix.os == 'macos-14'
run: |
pip install wheel setuptools
git clone https://github.com/phoebe-p/S4
cd S4
make S4_pyext --file="Makefile.m1"
cd ..
rm -rf S4
- name: Install S4 (ubuntu)
if: matrix.os == 'ubuntu-latest'
run: |
pip install wheel setuptools
git clone https://github.com/phoebe-p/S4
cd S4
make S4_pyext
cd ..
rm -rf S4
rm -rf S4
- name: Build solcore
run: |
Expand All @@ -82,7 +119,7 @@ jobs:
if: matrix.os == 'windows-latest'
run: |
cd D:\a\solcore5\solcore5\build-install\usr\Lib\site-packages
python -m pytest -r a -v --ignore=solcore/tests/test_examples.py
python -m pytest -r a -v --ignore=solcore/tests/test_examples.py -n "auto"
- name: Codecov
env:
Expand All @@ -98,8 +135,21 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ["3.9", "3.10", "3.11", "3.12"]
os: [ubuntu-latest, macos-13, windows-latest, macos-14]
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
exclude:
- os: macos-14
python-version: 3.7
- os: macos-14
python-version: 3.8
- os: macos-14
python-version: 3.9
- os: macos-13
python-version: 3.7
- os: macos-13
python-version: 3.8
- os: macos-13
python-version: 3.9

steps:
- name: Checkout
Expand All @@ -123,22 +173,47 @@ jobs:
sudo apt install -y gfortran ngspice python3-tk libboost-all-dev libopenblas-dev libfftw3-dev libsuitesparse-dev
- name: Install system dependencies in MacOS
if: matrix.os == 'macos-latest'
if: >-
( contains(matrix.os, 'macos') )
run: |
brew reinstall gfortran
brew reinstall gfortran openblas pkg-config
brew install ngspice boost suite-sparse
# - name: Install system dependencies in Windows
# if: matrix.os == 'windows-latest'
# run: choco install ngspice
- name: Install system dependencies in Windows
if: matrix.os == 'windows-latest'
run: choco install ngspice

- name: Install Python dependecies
run: |
pip install pytest meson-python ninja cython numpy spin
pip install --upgrade pip
pip install numpy --config-settings=setup-args="-Dallow-noblas=true"
pip install pytest meson-python ninja cython spin
python3 -m spin install-dependencies -test-dep
- name: Install S4
if: matrix.os != 'windows-latest'
# - name: Install S4 (macOS - x86)
# if: if: matrix.os == 'macos-13'
# run: |
# pip install wheel setuptools
# git clone https://github.com/phoebe-p/S4
# cd S4
# make S4_pyext --file="Makefile.mac_intel"
# cd ..
# rm -rf S4

- name: Install S4 (macOS - arm)
if: matrix.os == 'macos-14'
run: |
pip install wheel setuptools
git clone https://github.com/phoebe-p/S4
cd S4
make S4_pyext --file="Makefile.m1"
cd ..
rm -rf S4
- name: Install S4 (ubuntu)
if: matrix.os == 'ubuntu-latest'
run: |
pip install wheel setuptools
git clone https://github.com/phoebe-p/S4
Expand All @@ -157,8 +232,3 @@ jobs:
SOLCORE_SPICE: ngspice
run: |
python -m spin test -- -r a -v solcore/tests/test_examples.py -n "auto"
# - name: Unit and functional tests (Windows)
# if: matrix.os == 'windows-latest'
# run: |
# python -m spin test -- -r a -v solcore/tests/test_examples.py

0 comments on commit 2bbb6f6

Please sign in to comment.