Skip to content

Commit b1031da

Browse files
committed
simplify CI conditions for running core tests
1 parent 35f53b6 commit b1031da

File tree

1 file changed

+6
-22
lines changed

1 file changed

+6
-22
lines changed

.github/workflows/core-test.yml

Lines changed: 6 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,16 @@ on:
44
pull_request:
55
branches: [master]
66
types: [synchronize, opened, reopened, ready_for_review]
7+
paths:
8+
- 'neo/core/**'
9+
- 'pyproject.toml'
710

811
# run checks on any change of master, including merge of PRs
912
push:
1013
branches: [master]
14+
paths:
15+
- 'neo/core/**'
16+
- 'pyproject.toml'
1117

1218
concurrency: # Cancel previous workflows on the same pull request
1319
group: ${{ github.workflow }}-${{ github.ref }}
@@ -44,40 +50,18 @@ jobs:
4450
- name: Checkout repository
4551
uses: actions/checkout@v3
4652

47-
- name: Get changed files
48-
id: changed-files
49-
uses: tj-actions/changed-files@v35
50-
51-
- name: Module changes
52-
id: modules-changed
53-
# check if core (or toml) has been changed.
54-
run: |
55-
for file in ${{ steps.changed-files.outputs.all_changed_files }}; do
56-
if [[ $file == *"/core/"* || $file == *"/pyproject.toml" ]]; then
57-
echo "Core changed"
58-
echo "CORE_CHANGED=true" >> $GITHUB_OUTPUT
59-
fi
60-
done
61-
shell: bash # Necessary for pipeline to work on windows
62-
63-
- name: Core changed?
64-
run: echo "Core changed == ${{steps.modules-changed.outputs.CORE_CHANGED == 'true'}}"
65-
6653
- name: Install numpy ${{ matrix.numpy-version }}
67-
if: ${{ steps.modules-changed.outputs.CORE_CHANGED == 'true' }}
6854
run: |
6955
python -m pip install --upgrade pip
7056
pip install numpy==${{ matrix.numpy-version }}
7157
pip install pytest pytest-cov
7258
pip install .
7359
7460
- name: List pip packages
75-
if: ${{ steps.modules-changed.outputs.CORE_CHANGED == 'true' }}
7661
run: |
7762
pip -V
7863
pip list
7964
8065
- name: Run tests
81-
if: ${{ steps.modules-changed.outputs.CORE_CHANGED == 'true' }}
8266
run: |
8367
pytest --cov=neo neo/test/coretest

0 commit comments

Comments
 (0)