Skip to content

Commit cd38df2

Browse files
authored
Merge pull request #113 from IIT-EnergySystemModels/ci/consolidate-workflows
ci: consolidate workflows into ci.yml, drop broken python-app.yml
2 parents cde6722 + a534626 commit cd38df2

5 files changed

Lines changed: 27 additions & 66 deletions

File tree

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
1-
name: Python Package using Conda
1+
name: CI
22

3-
on: [push, pull_request]
3+
on:
4+
push:
5+
branches: [master, main]
6+
pull_request:
7+
8+
concurrency:
9+
group: ${{ github.workflow }}-${{ github.ref }}
10+
cancel-in-progress: true
411

512
jobs:
613
build:
@@ -9,12 +16,11 @@ jobs:
916
fail-fast: false
1017
matrix:
1118
os: [ubuntu-latest, macos-latest, windows-latest]
12-
python-version: ["3.12", "3.13"]
19+
python-version: ["3.11", "3.12", "3.13"]
1320

1421
steps:
1522
- uses: actions/checkout@v4
1623

17-
# 1) Install Conda (Miniforge) + activate an env
1824
- name: Set up Conda (Miniforge) + Python ${{ matrix.python-version }}
1925
uses: conda-incubator/setup-miniconda@v3
2026
with:
@@ -26,35 +32,29 @@ jobs:
2632
channels: conda-forge,defaults
2733
channel-priority: strict
2834

29-
# Important: ensures "conda activate ci" applies to all run steps
3035
- name: Show conda info
3136
shell: bash -l {0}
3237
run: |
3338
conda info
3439
python --version
35-
which python || where python
3640
37-
# 2) Install uv (so "uv pip ..." works)
3841
- name: Set up uv
3942
uses: astral-sh/setup-uv@v3
4043

41-
# 3) Install dependencies
4244
- name: Install dependencies
4345
shell: bash -l {0}
4446
run: |
45-
conda install -y -c conda-forge glpk cartopy
47+
conda install -y -c conda-forge flake8 pytest
4648
uv pip install --system -r requirements.lock
49+
uv pip install --system highspy
4750
pip install -e .
48-
pip install highspy
4951
50-
- name: Lint with flake8
52+
- name: Lint with flake8 (syntax errors only)
5153
shell: bash -l {0}
5254
run: |
53-
conda install -y flake8
5455
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
55-
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
56+
5657
- name: Test with pytest
5758
shell: bash -l {0}
5859
run: |
59-
conda install -y pytest
60-
pytest -vv tests/test_run.py
60+
pytest -vv tests/

.github/workflows/colab-compatibility.yml

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,13 @@ name: Google Colab Compatibility
22

33
on:
44
push:
5-
branches: [ master, main ]
5+
branches: [master, main]
66
pull_request:
7-
branches: [ master, main ]
7+
branches: [master, main]
8+
9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.ref }}
11+
cancel-in-progress: true
812

913
jobs:
1014
colab-test:
@@ -16,22 +20,14 @@ jobs:
1620
uses: actions/setup-python@v5
1721
with:
1822
python-version: '3.11'
19-
20-
- name: Install system dependencies
21-
run: |
22-
sudo apt-get update
23-
sudo apt-get install -y glpk-utils
23+
cache: 'pip'
2424

2525
- name: Install openTEPES
2626
run: |
2727
python -m pip install --upgrade pip
2828
pip install .
2929
pip install pytest highspy
3030
31-
- name: Check version
32-
run: |
33-
python -c "import openTEPES; print(openTEPES.__version__)" || echo "No version defined"
34-
3531
- name: Run tests
3632
run: |
3733
pytest -vv tests/test_run.py

.github/workflows/python-app.yml

Lines changed: 0 additions & 39 deletions
This file was deleted.

pyproject.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,7 @@ requires = [
3838

3939
[tool.flit.scripts]
4040
openTEPES_Main = "openTEPES:main"
41+
42+
[tool.pytest.ini_options]
43+
testpaths = ["tests"]
44+
python_files = ["test_*.py"]

tests/test_run.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def case_7d_system(request):
2020
os.path.join(os.path.dirname(__file__), "../openTEPES")
2121
),
2222
CaseName=case_name,
23-
SolverName="glpk", # or "gurobi" or "appsi_highs"
23+
SolverName="highs", # or "gurobi" or "glpk"
2424
pIndLogConsole=0,
2525
pIndOutputResults=0,
2626
)

0 commit comments

Comments
 (0)