Skip to content

Commit f7360a8

Browse files
author
Shyue Ping Ong
committed
Fix test workflow again.
1 parent 4f25fe0 commit f7360a8

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

.github/workflows/test.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -118,21 +118,21 @@ jobs:
118118
python -m pip install numpy cython packaging
119119
python -m pip install -e '.[dev,optional]'
120120
- name: pytest split ${{ matrix.split }}
121-
if: github.event_name == 'release'
121+
if: github.event_name == 'release' || github.event_name == 'push'
122122
# For releases, we do non-parallel runs, which usually makes sure that the coverage is properly completed.
123123
run: |
124124
pytest --cov=pymatgen tests
125125
- name: pytest split ${{ matrix.split }}
126-
if: github.event_name != 'release'
126+
if: github.event_name == 'pull_request'
127127
# To update the test durations, do pip install pytest-split and run
128128
# pytest --store-durations --durations-path tests/files/.pytest-split-durations
129129
# and commit the results (requires pip install pytest-split)
130130
run: |
131-
pytest --cov=pymatgen --splits 10 --group ${{ matrix.split }} --durations-path tests/files/.pytest-split-durations tests
131+
pytest --splits 10 --group ${{ matrix.split }} --durations-path tests/files/.pytest-split-durations tests
132132
- name: Upload coverage
133133
# Only upload coverage for ubuntu py3.11 runs. Continue on error as coverage is not critical.
134134
continue-on-error: true
135-
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.11'
135+
if: github.event_name != 'pull_request' && matrix.os == 'ubuntu-latest' && matrix.python-version == '3.11'
136136
uses: actions/upload-artifact@v3
137137
with:
138138
name: coverage-${{ matrix.split }}
@@ -141,6 +141,7 @@ jobs:
141141
coverage:
142142
# Only upload coverage for ubuntu py3.11 runs. Continue on error as coverage is not critical.
143143
continue-on-error: true
144+
if: github.event_name != 'pull_request'
144145
needs: test
145146
runs-on: ubuntu-latest
146147
steps:

0 commit comments

Comments
 (0)