Skip to content

Commit

Permalink
update yml for CI
Browse files Browse the repository at this point in the history
  • Loading branch information
dguittet committed Mar 15, 2024
1 parent e76a37a commit 5d398db
Show file tree
Hide file tree
Showing 4 changed files with 62 additions and 49 deletions.
101 changes: 55 additions & 46 deletions .github/workflows/test_pkg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,50 +3,55 @@ name: Test Package
on: [ push ]

jobs:
# build_1:

# runs-on: ${{ matrix.os }}
# strategy:
# matrix:
# os: [ubuntu-latest, windows-latest, macOS-13]
# python-version: [ '3.8', '3.9', '3.10', '3.11', '3.12' ]

# env:
# SAMNTDIR: ${{ github.workspace }}/../SAM
# NREL_API_KEY: ${{ secrets.NREL_API_KEY }}
# NREL_API_EMAIL: ${{ secrets.NREL_API_EMAIL }}

# name: ${{ matrix.os }} ${{ matrix.python-version }}
# steps:
# - uses: actions/checkout@v3
# - name: Setup conda
# uses: s-weigand/setup-conda@v1
# with:
# update-conda: true
# python-version: ${{ matrix.python-version }}
# conda-channels: anaconda, conda-forge
# - run: conda --version
# - run: which python

# - name: Checkout Repo
# uses: actions/checkout@v3

# - name: Install NREL-PySAM
# run: |
# pip install -r requirements.txt
# pip install -r tests/requirements.txt
# conda install -c nrel nrel-pysam

# - uses: actions/checkout@v3
# - name: Checkout SAM
# run: |
# cd ..
# git config --global url.https://github.com/.insteadOf git://github.com/
# git clone https://github.com/NREL/SAM.git

# - name: Unit tests
# run: |
# pytest tests/test_pysam_all.py
build_1:

runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
python-version: [ '3.8', '3.9', '3.10', '3.11', '3.12' ]

env:
SAMNTDIR: ${{ github.workspace }}/../SAM
NREL_API_KEY: ${{ secrets.NREL_API_KEY }}
NREL_API_EMAIL: ${{ secrets.NREL_API_EMAIL }}

name: ${{ matrix.os }} ${{ matrix.python-version }}
steps:
- uses: actions/checkout@v3
- name: Setup conda
uses: s-weigand/setup-conda@v1
with:
update-conda: true
python-version: ${{ matrix.python-version }}
conda-channels: anaconda, conda-forge
- run: conda --version
- run: which python

- name: Checkout Repo
uses: actions/checkout@v3

- name: Get PySAM Version
run: |
VER=$(python -c "from files.version import __version__; print(__version__)")
echo "VERSION=$VER" >> $GITHUB_ENV
- name: Install NREL-PySAM
run: |
pip install -r requirements.txt
pip install -r tests/requirements.txt
conda install -c nrel nrel-pysam==${{ env.VERSION }}
- uses: actions/checkout@v3
- name: Checkout SAM
run: |
cd ..
git config --global url.https://github.com/.insteadOf git://github.com/
git clone https://github.com/NREL/SAM.git
- name: Unit tests
run: |
pytest tests/test_pysam_all.py
build_2:
runs-on: ${{ matrix.os }}
Expand All @@ -63,7 +68,6 @@ jobs:
name: ${{ matrix.os }} ${{ matrix.python-version }}
steps:
- name: Install conda Mac arm64
if: ${{ matrix.os }} == 'macos-14'
run: |
mkdir -p ~/miniconda3
curl https://repo.anaconda.com/miniconda/Miniconda3-latest-MacOSX-arm64.sh -o ~/miniconda3/miniconda.sh
Expand All @@ -79,13 +83,18 @@ jobs:
- name: Checkout Repo
uses: actions/checkout@v3

- name: Get PySAM Version
run: |
VER=$(python -c "from files.version import __version__; print(__version__)")
echo "VERSION=$VER" >> $GITHUB_ENV
- name: Install NREL-PySAM
run: |
source /Users/runner/.bash_profile
conda activate pysam_env
pip install -r requirements.txt
pip install -r tests/requirements.txt
conda install -c nrel nrel-pysam
conda install -c nrel nrel-pysam==${{ env.VERSION }}
- uses: actions/checkout@v3
- name: Checkout SAM
Expand Down
4 changes: 3 additions & 1 deletion build_unix.sh
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,9 @@ fi
rename -s linux manylinux2014 $PYSAMDIR/dist/*-linux_*


twine upload $PYSAMDIR/dist/*.whl
anaconda upload -u nrel $PYSAMDIR/dist/osx-64/*.tar.bz2
anaconda upload -u nrel $PYSAMDIR/dist/linux-64/*.tar.bz2

# only upload to PyPi after Github Actions test of new package passes
# twine upload $PYSAMDIR/dist/*.whl

4 changes: 3 additions & 1 deletion build_win.bat
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,10 @@ FOR %%i IN (pysam_build_3.8 pysam_build_3.9 pysam_build_3.10 pysam_build_3.11, p
)
python setup.py bdist_wheel
)
REM twine upload dist/*.whl
REM %bash% build_conda.sh
REM anaconda upload -u nrel dist/*.tar.bz2

REM only upload to PyPi after Github Actions test of new package passes
REM twine upload dist/*.whl

REM rmdir %SSCDIR%\..\build_pysam /s
2 changes: 1 addition & 1 deletion modules/Hybrid.c
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ Common_set_input(VarGroupObject *self, PyObject *value, void *closure)

static PyGetSetDef Common_getset[] = {
{"input", (getter)Common_get_input,(setter)Common_set_input,
PyDoc_STR("*dict*: input_table for multiple technologies and one financial market\n\n**Info:**\npvsamv1,pvwattsv8,windpower,generic_system,battery,fuelcell,hybrid\n\n**Required:**\nTrue"),
PyDoc_STR("*dict*: input_table for multiple technologies and one financial market\n\n**Required:**\nTrue"),
NULL},
{NULL} /* Sentinel */
};
Expand Down

0 comments on commit 5d398db

Please sign in to comment.