0.6.4 #88
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 workflow will install Python dependencies, run tests, lint (black), apply semantic releases, build a Python package and push it to PyPI | |
name: OOPNET build | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
jobs: | |
code-test: | |
runs-on: ubuntu-latest | |
if: ${{ github.actor != 'OOPNET-bot'}} | |
strategy: | |
matrix: | |
python-version: [ 3.9, "3.10", "3.11"] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Checkout linux_epanet_2.2 | |
uses: actions/checkout@v2 | |
with: | |
token: ${{ secrets.OOPNET_TOKEN }} | |
repository: oopnet/linux_epanet_2.2 | |
path: linux_epanet_2.2 | |
- name: Setup EPANET | |
run: ./linux_epanet_2.2/setup.sh | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v1 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install pytest | |
if [ -f requirements-dev.txt ]; then pip install -r requirements-dev.txt; fi | |
- name: Test with pytest | |
run: | | |
pytest | |
build: | |
runs-on: ubuntu-latest | |
needs: code-test | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
token: ${{ secrets.OOPNET_TOKEN }} | |
- name: Python Semantic Release | |
uses: relekang/python-semantic-release@v7.34.6 | |
with: | |
github_token: ${{ secrets.OOPNET_TOKEN }} | |
repository_username: __token__ | |
repository_password: ${{ secrets.PyPI_TOKEN }} | |
package-test: | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- name: Checkout linux_epanet_2.2 | |
uses: actions/checkout@v2 | |
with: | |
token: ${{ secrets.OOPNET_TOKEN }} | |
repository: oopnet/linux_epanet_2.2 | |
path: linux_epanet_2.2 | |
- name: Setup EPANET | |
run: ./linux_epanet_2.2/setup.sh | |
- name: Set up Python 3.9 | |
uses: actions/setup-python@v2 | |
with: | |
python-version: "3.9" | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install oopnet | |
- name: Import test | |
run: | | |
python -c "import oopnet" |