|
4 | 4 | pull_request: |
5 | 5 | branches: [master] |
6 | 6 | types: [synchronize, opened, reopened, ready_for_review] |
| 7 | + paths: |
| 8 | + - 'neo/core/**' |
| 9 | + - 'pyproject.toml' |
7 | 10 |
|
8 | 11 | # run checks on any change of master, including merge of PRs |
9 | 12 | push: |
10 | 13 | branches: [master] |
| 14 | + paths: |
| 15 | + - 'neo/core/**' |
| 16 | + - 'pyproject.toml' |
11 | 17 |
|
12 | 18 | concurrency: # Cancel previous workflows on the same pull request |
13 | 19 | group: ${{ github.workflow }}-${{ github.ref }} |
@@ -44,40 +50,18 @@ jobs: |
44 | 50 | - name: Checkout repository |
45 | 51 | uses: actions/checkout@v3 |
46 | 52 |
|
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 | | - |
66 | 53 | - name: Install numpy ${{ matrix.numpy-version }} |
67 | | - if: ${{ steps.modules-changed.outputs.CORE_CHANGED == 'true' }} |
68 | 54 | run: | |
69 | 55 | python -m pip install --upgrade pip |
70 | 56 | pip install numpy==${{ matrix.numpy-version }} |
71 | 57 | pip install pytest pytest-cov |
72 | 58 | pip install . |
73 | 59 |
|
74 | 60 | - name: List pip packages |
75 | | - if: ${{ steps.modules-changed.outputs.CORE_CHANGED == 'true' }} |
76 | 61 | run: | |
77 | 62 | pip -V |
78 | 63 | pip list |
79 | 64 |
|
80 | 65 | - name: Run tests |
81 | | - if: ${{ steps.modules-changed.outputs.CORE_CHANGED == 'true' }} |
82 | 66 | run: | |
83 | 67 | pytest --cov=neo neo/test/coretest |
0 commit comments