-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #44 from e2nIEE/release/v1.5.0
Release/v1.5.0
- Loading branch information
Showing
31 changed files
with
656 additions
and
486 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
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,58 @@ | ||
# This workflow will create a Python package and upload it to testPyPi or PyPi | ||
# Then, it installs simbench from there and all dependencies and runs tests with different Python versions | ||
|
||
name: test | ||
|
||
# Controls when the action will run. | ||
on: | ||
# Allows you to run this workflow manually from the Actions tab | ||
push: | ||
branches: | ||
- release/* | ||
|
||
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | ||
jobs: | ||
|
||
build: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12'] | ||
os: [ ubuntu-latest, windows-latest ] | ||
|
||
steps: | ||
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Install simbench & dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
python -m pip install pytest-split matplotlib geopandas | ||
python -m pip install .["all"] | ||
- name: Install specific dependencies (Windows) | ||
if: matrix.os == 'windows-latest' | ||
run: | | ||
if ( '${{ matrix.python-version }}' -eq '3.9' ) { python -m pip install pypower } | ||
if ( '${{ matrix.python-version }}' -ne '3.9' ) { python -m pip install numba } | ||
if ( '${{ matrix.python-version }}' -eq '3.8' -or '${{ matrix.python-version }}' -eq '3.10' ) { python -m pip install lightsim2grid } | ||
- name: Install specific dependencies (Ubuntu) | ||
if: matrix.os == 'ubuntu-latest' | ||
run: | | ||
if ${{ matrix.python-version == '3.9' }}; then python -m pip install pypower; fi | ||
if ${{ matrix.python-version != '3.9' }}; then python -m pip install numba; fi | ||
if ${{ matrix.python-version == '3.8' || matrix.python-version == '3.10' }}; then python -m pip install lightsim2grid; fi | ||
- name: List all installed packages | ||
run: | | ||
python -m pip list | ||
- name: Test with pytest | ||
run: | | ||
python -m pytest --pyargs simbench.test |
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 |
---|---|---|
@@ -0,0 +1,53 @@ | ||
# This workflow will create a Python package and upload it to testPyPi or PyPi | ||
# Then, it installs simbench from there and all dependencies and runs tests with different Python versions | ||
|
||
name: upload | ||
|
||
# Controls when the action will run. | ||
on: | ||
# Allows you to run this workflow manually from the Actions tab | ||
push: | ||
tags: | ||
- 'v*' | ||
branches: | ||
- master | ||
|
||
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | ||
jobs: | ||
|
||
upload: | ||
# The type of runner that the job will run on | ||
runs-on: ubuntu-latest | ||
|
||
# Steps represent a sequence of tasks that will be executed as part of the job | ||
steps: | ||
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | ||
- uses: actions/checkout@v4 | ||
|
||
# Sets up python3 | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.10' | ||
# Installs and upgrades pip, installs other dependencies and installs the package from setup.py | ||
- name: Install dependencies | ||
run: | | ||
# Upgrade pip | ||
python3 -m pip install --upgrade pip | ||
# Install twine | ||
python3 -m pip install setuptools wheel twine | ||
# Upload to PyPI | ||
- name: Build and Upload to PyPI | ||
run: | | ||
python3 setup.py sdist --formats=zip | ||
twine check dist/* --strict | ||
python3 -m twine upload dist/* | ||
env: | ||
TWINE_USERNAME: __token__ | ||
TWINE_PASSWORD: ${{ secrets.PYPI }} | ||
TWINE_REPOSITORY: pypi | ||
|
||
- name: Sleep for 150s to make release available | ||
uses: juliangruber/sleep-action@v2 | ||
with: | ||
time: 300s |
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
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
Oops, something went wrong.