|
1 | 1 | name: CI |
2 | 2 |
|
3 | | -on: |
| 3 | +on: |
4 | 4 | push: |
5 | | - path: |
6 | | - - 'deepmatch/*' |
7 | | - - 'tests/*' |
| 5 | + paths: |
| 6 | + - 'deepmatch/**' |
| 7 | + - 'tests/**' |
| 8 | + - 'setup.py' |
| 9 | + - '.github/workflows/**' |
8 | 10 | pull_request: |
9 | | - path: |
10 | | - - 'deepmatch/*' |
11 | | - - 'tests/*' |
| 11 | + workflow_dispatch: |
| 12 | + |
| 13 | +concurrency: |
| 14 | + group: ${{ github.workflow }}-${{ github.head_ref || github.ref_name }} |
| 15 | + cancel-in-progress: true |
12 | 16 |
|
13 | 17 | jobs: |
14 | 18 | build: |
15 | | - |
16 | | - runs-on: ubuntu-latest |
17 | | - timeout-minutes: 120 |
| 19 | + runs-on: ubuntu-22.04 |
| 20 | + timeout-minutes: 240 |
18 | 21 | strategy: |
| 22 | + fail-fast: false |
19 | 23 | matrix: |
20 | | - python-version: [3.6,3.7,3.8,3.9,3.10.7] |
21 | | - tf-version: [1.9.0,1.14.0,2.5.0] |
22 | | - |
23 | | - exclude: |
24 | | - - python-version: 3.7 |
25 | | - tf-version: 1.4.0 |
26 | | - - python-version: 3.7 |
27 | | - tf-version: 1.9.0 |
28 | | - - python-version: 3.7 |
29 | | - tf-version: 1.10.0 |
30 | | - - python-version: 3.7 |
31 | | - tf-version: 1.11.0 |
32 | | - - python-version: 3.7 |
33 | | - tf-version: 1.12.0 |
34 | | - - python-version: 3.7 |
35 | | - tf-version: 1.13.0 |
36 | | - - python-version: 3.7 |
37 | | - tf-version: 1.15.0 |
38 | | - - python-version: 3.8 |
39 | | - tf-version: 1.4.0 |
40 | | - - python-version: 3.8 |
41 | | - tf-version: 1.9.0 |
42 | | - - python-version: 3.8 |
43 | | - tf-version: 1.10.0 |
44 | | - - python-version: 3.8 |
45 | | - tf-version: 1.11.0 |
46 | | - - python-version: 3.8 |
47 | | - tf-version: 1.12.0 |
48 | | - - python-version: 3.8 |
49 | | - tf-version: 1.13.0 |
50 | | - - python-version: 3.8 |
51 | | - tf-version: 1.14.0 |
52 | | - - python-version: 3.8 |
53 | | - tf-version: 1.15.0 |
54 | | - - python-version: 3.6 |
55 | | - tf-version: 2.7.0 |
56 | | - - python-version: 3.6 |
57 | | - tf-version: 2.8.0 |
58 | | - - python-version: 3.6 |
59 | | - tf-version: 2.9.0 |
60 | | - - python-version: 3.6 |
61 | | - tf-version: 2.10.0 |
62 | | - - python-version: 3.9 |
63 | | - tf-version: 1.4.0 |
64 | | - - python-version: 3.9 |
65 | | - tf-version: 1.9.0 |
66 | | - - python-version: 3.9 |
67 | | - tf-version: 1.15.0 |
68 | | - - python-version: 3.9 |
69 | | - tf-version: 1.14.0 |
70 | | - - python-version: 3.10.7 |
71 | | - tf-version: 1.4.0 |
72 | | - - python-version: 3.10.7 |
73 | | - tf-version: 1.9.0 |
74 | | - - python-version: 3.10.7 |
75 | | - tf-version: 1.15.0 |
76 | | - - python-version: 3.10.7 |
77 | | - tf-version: 1.14.0 |
78 | | - - python-version: 3.10.7 |
79 | | - tf-version: 2.5.0 |
80 | | - - python-version: 3.10.7 |
81 | | - tf-version: 2.6.0 |
| 24 | + include: |
| 25 | + - python-version: "3.7" |
| 26 | + tf-version: "1.15.5" |
| 27 | + protobuf-version: "3.19.0" |
| 28 | + - python-version: "3.10" |
| 29 | + tf-version: "2.10.0" |
| 30 | + protobuf-version: "" |
| 31 | + - python-version: "3.10" |
| 32 | + tf-version: "2.15.0" |
| 33 | + protobuf-version: "" |
| 34 | + - python-version: "3.11" |
| 35 | + tf-version: "2.15.0" |
| 36 | + protobuf-version: "" |
82 | 37 |
|
83 | 38 | steps: |
| 39 | + - uses: actions/checkout@v5 |
| 40 | + |
| 41 | + - name: Detect code-related changes |
| 42 | + id: filter |
| 43 | + uses: dorny/paths-filter@v3 |
| 44 | + with: |
| 45 | + filters: | |
| 46 | + code_related: |
| 47 | + - 'deepmatch/**' |
| 48 | + - 'tests/**' |
| 49 | + - 'setup.py' |
| 50 | + - '.github/workflows/**' |
| 51 | +
|
| 52 | + - name: Docs-only PR fast-path |
| 53 | + if: ${{ github.event_name == 'pull_request' && steps.filter.outputs.code_related != 'true' }} |
| 54 | + run: echo "Docs-only PR detected; skipping heavy CI steps." |
| 55 | + |
| 56 | + - name: Setup python environment |
| 57 | + if: ${{ github.event_name != 'pull_request' || steps.filter.outputs.code_related == 'true' }} |
| 58 | + uses: actions/setup-python@v6 |
| 59 | + with: |
| 60 | + python-version: ${{ matrix.python-version }} |
| 61 | + |
| 62 | + - name: Install dependencies |
| 63 | + if: ${{ github.event_name != 'pull_request' || steps.filter.outputs.code_related == 'true' }} |
| 64 | + run: | |
| 65 | + python -m pip install -q --upgrade pip setuptools wheel |
| 66 | + python -m pip install -q "numpy<2" |
| 67 | + python -m pip install -q tensorflow==${{ matrix.tf-version }} |
| 68 | + python -m pip install -q pytest pytest-cov |
| 69 | + python -m pip install -e . |
| 70 | +
|
| 71 | + - name: Install TF1 protobuf pin |
| 72 | + if: ${{ (github.event_name != 'pull_request' || steps.filter.outputs.code_related == 'true') && matrix.protobuf-version != '' }} |
| 73 | + run: | |
| 74 | + python -m pip install -q protobuf==${{ matrix.protobuf-version }} |
84 | 75 |
|
85 | | - - uses: actions/checkout@v3 |
| 76 | + - name: Dependency check |
| 77 | + if: ${{ github.event_name != 'pull_request' || steps.filter.outputs.code_related == 'true' }} |
| 78 | + run: | |
| 79 | + python -m pip check |
86 | 80 |
|
87 | | - - name: Setup python environment |
88 | | - uses: actions/setup-python@v4 |
89 | | - with: |
90 | | - python-version: ${{ matrix.python-version }} |
| 81 | + - name: Test with pytest |
| 82 | + if: ${{ github.event_name != 'pull_request' || steps.filter.outputs.code_related == 'true' }} |
| 83 | + timeout-minutes: 240 |
| 84 | + run: | |
| 85 | + pytest --cov=deepmatch --cov-report=xml --cov-report=term-missing:skip-covered |
91 | 86 |
|
92 | | - - name: Install dependencies |
93 | | - run: | |
94 | | - sudo apt update && sudo apt install -y pkg-config libhdf5-dev |
95 | | - pip3 install -q tensorflow==${{ matrix.tf-version }} |
96 | | - pip install -q protobuf==3.19.0 |
97 | | - pip install -q requests |
98 | | - pip install -e . |
99 | | - - name: Test with pytest |
100 | | - timeout-minutes: 120 |
101 | | - run: | |
102 | | - pip install -q pytest |
103 | | - pip install -q pytest-cov |
104 | | - pip install -q python-coveralls |
105 | | - pytest --cov=deepmatch --cov-report=xml |
106 | | - - name: Upload coverage to Codecov |
107 | | - uses: codecov/codecov-action@v3.1.0 |
108 | | - with: |
109 | | - token: ${{secrets.CODECOV_TOKEN}} |
110 | | - file: ./coverage.xml |
111 | | - flags: pytest |
112 | | - name: py${{ matrix.python-version }}-tf${{ matrix.tf-version }} |
| 87 | + - name: Upload coverage to Codecov |
| 88 | + if: ${{ github.event_name != 'pull_request' || steps.filter.outputs.code_related == 'true' }} |
| 89 | + uses: codecov/codecov-action@v6 |
| 90 | + with: |
| 91 | + token: ${{ secrets.CODECOV_TOKEN }} |
| 92 | + files: ./coverage.xml |
| 93 | + flags: pytest |
| 94 | + name: py${{ matrix.python-version }}-tf${{ matrix.tf-version }} |
0 commit comments