@@ -10,17 +10,15 @@ jobs:
1010 format :
1111 runs-on : ubuntu-latest
1212 steps :
13- - uses : actions/checkout@v3
14- with :
15- ref : ${{ github.head_ref }}
13+ - uses : actions/checkout@v4
1614
1715 - name : Set up Python
18- uses : actions/setup-python@v4
16+ uses : actions/setup-python@v5
1917 with :
2018 python-version : " 3.11"
2119
2220 - name : Cache PDM dependencies
23- uses : actions/cache@v3
21+ uses : actions/cache@v4
2422 with :
2523 path : |
2624 ~/.cache/pdm
@@ -36,31 +34,32 @@ jobs:
3634
3735 - name : Install dependencies
3836 run : |
39- pdm install --no-lock -G test
37+ pdm install --check -- no-lock -G test
4038
41- - name : Run black
39+ - name : Check code formatting (Black)
40+ id : black
4241 run : |
43- pdm run black .
42+ pdm run black --check .
4443
45- - name : Commit changes
46- uses : stefanzweifel/git-auto-commit-action@v4
47- with :
48- commit_message : " style: format code with black"
49- branch : ${{ github.head_ref }}
44+ - name : Help - Formatting
45+ if : failure() && steps.black.outcome == 'failure'
46+ run : |
47+ echo "::error::❌ Code formatting check failed."
48+ echo "To fix this, run the following command locally:"
49+ echo " pdm run black ."
5050
5151 lint :
52- needs : format
5352 runs-on : ubuntu-latest
5453 steps :
55- - uses : actions/checkout@v3
54+ - uses : actions/checkout@v4
5655
5756 - name : Set up Python
58- uses : actions/setup-python@v4
57+ uses : actions/setup-python@v5
5958 with :
6059 python-version : " 3.11"
6160
6261 - name : Cache PDM dependencies
63- uses : actions/cache@v3
62+ uses : actions/cache@v4
6463 with :
6564 path : |
6665 ~/.cache/pdm
@@ -74,43 +73,58 @@ jobs:
7473 python -m pip install --upgrade pip
7574 pip install pdm
7675
77- - name : Lock dependencies
78- run : |
79- pdm fix
80- pdm lock --group :all
81-
8276 - name : Install dependencies
8377 run : |
84- pdm install --no-lock -G test
78+ pdm install --check -- no-lock -G test
8579
8680 - name : Run flake8
81+ id : flake8
8782 run : |
8883 pdm run flake8
8984
85+ - name : Help - Flake8
86+ if : failure() && steps.flake8.outcome == 'failure'
87+ run : |
88+ echo "::error::❌ Flake8 check failed."
89+ echo "To fix this, run the following command locally:"
90+ echo " pdm run flake8"
91+
92+ - name : Run mypy
93+ id : mypy
94+ continue-on-error : true # Allow failure until codebase is fully typed
95+ run : |
96+ pdm run mypy .
97+
98+ - name : Help - Mypy
99+ if : steps.mypy.outcome == 'failure'
100+ run : |
101+ echo "::warning::⚠️ Mypy check failed (non-blocking)."
102+ echo "To view these errors locally, run:"
103+ echo " pdm run mypy ."
104+
90105 test :
91- needs : lint
92106 runs-on : ubuntu-latest
93- timeout-minutes : 30 # Add timeout to prevent hanging
107+ timeout-minutes : 30
94108 strategy :
95109 fail-fast : false
96110 matrix :
97111 python-version : ["3.11"]
98112
99113 steps :
100- - uses : actions/checkout@v3
114+ - uses : actions/checkout@v4
101115
102116 - name : Set up Python ${{ matrix.python-version }}
103- uses : actions/setup-python@v4
117+ uses : actions/setup-python@v5
104118 with :
105119 python-version : ${{ matrix.python-version }}
106120
107121 - name : Cache PDM dependencies
108- uses : actions/cache@v3
122+ uses : actions/cache@v4
109123 with :
110124 path : |
111125 ~/.cache/pdm
112126 .pdm-build
113- key : ${{ runner.os }}-pdm-${{ hashFiles('**/pdm.lock') }}-${{ matrix.python-version }}
127+ key : ${{ runner.os }}-pdm-${{ matrix.python-version }}-${{ hashFiles('**/pdm.lock') }}
114128 restore-keys : |
115129 ${{ runner.os }}-pdm-${{ matrix.python-version }}-
116130
@@ -119,28 +133,30 @@ jobs:
119133 python -m pip install --upgrade pip
120134 pip install pdm
121135
122- - name : Lock dependencies
123- run : |
124- pdm fix
125- pdm lock --group :all
126-
127136 - name : Install dependencies
128137 run : |
129- pdm install --no-lock -G test
138+ pdm install --check -- no-lock -G test
130139
131- - name : Run tests
132- run : |
133- pdm run pytest tests/ -v -m "not slow" -n auto --cov=indeca --cov-report=xml
134- pdm run plot_test
140+ - name : Run Unit Tests
141+ run : pdm run pytest tests/unit -v -n auto --cov=indeca --cov-report=xml
142+
143+ - name : Run Integration & Regression Tests
144+ run : pdm run pytest tests/integration tests/regression -v -n auto -m "not slow" --cov=indeca --cov-report=xml --cov-append
145+
146+ - name : Run Other Tests (Robustness, Validation, Demo)
147+ run : pdm run pytest tests/robustness tests/validation tests/demo -v -n auto -m "not slow" --cov=indeca --cov-report=xml --cov-append
148+
149+ - name : Generate Plot Artifacts
150+ run : pdm run plot_test
135151
136152 - uses : actions/upload-artifact@v4
137- continue-on-error : true
153+ if : always() # Upload artifacts even if tests fail
138154 with :
139- name : test_output
155+ name : test_output_${{ matrix.python-version }}
140156 path : tests/output
141157
142158 - name : Upload coverage to Codecov
143- uses : codecov/codecov-action@v3
159+ uses : codecov/codecov-action@v4
144160 with :
145161 file : ./coverage.xml
146- fail_ci_if_error : false # Don't fail if coverage upload fails
162+ fail_ci_if_error : false
0 commit comments