|
1 | 1 | name: CI |
2 | | - |
3 | 2 | on: |
4 | 3 | push: |
5 | 4 | branches: |
|
17 | 16 |
|
18 | 17 |
|
19 | 18 | jobs: |
20 | | - linters: |
21 | | - name: Linters - ${{ matrix.os.on }} - ${{ matrix.python.version }} |
22 | | - runs-on: ${{ matrix.os.on }} |
| 19 | + pymodbus: |
| 20 | + name: ${{ matrix.os }} - ${{ matrix.python }} |
| 21 | + runs-on: ${{ matrix.os }} |
23 | 22 | timeout-minutes: 10 |
24 | 23 | strategy: |
25 | 24 | fail-fast: false |
26 | 25 | matrix: |
27 | | - os: |
28 | | - - on: ubuntu-latest |
29 | | - # - on: macos-latest |
30 | | - # - on: windows-latest |
31 | | - python: |
32 | | - - version: '3.8' |
33 | | - - version: '3.9' |
34 | | - - version: '3.10' |
35 | | - - version: '3.11' |
36 | | - - version: '3.12' |
| 26 | + os: [ubuntu-latest, macos-latest, windows-latest] |
| 27 | + python: ['3.8', '3.9', '3.10', '3.11', '3.12'] |
| 28 | + include: |
| 29 | + - python: '3.8' |
| 30 | + run_lint: true |
| 31 | + - python: '3.12' |
| 32 | + run_doc: true |
| 33 | + run_lint: true |
| 34 | + - os: macos-latest |
| 35 | + run_doc: false |
| 36 | + run_lint: false |
| 37 | + - os: windows-latest |
| 38 | + run_doc: false |
| 39 | + run_lint: false |
| 40 | + |
37 | 41 | steps: |
38 | | - - uses: actions/checkout@v3 |
39 | | - - uses: actions/setup-python@v4 |
| 42 | + - name: Checkout repo from github |
| 43 | + |
| 44 | + |
| 45 | + - name: Set up Python ${{ matrix.python }} |
| 46 | + |
| 47 | + with: |
| 48 | + python-version: ${{ matrix.python }} |
| 49 | + |
| 50 | + - name: Restore base Python virtual environment |
| 51 | + id: cache-venv |
| 52 | + |
40 | 53 | with: |
41 | | - python-version: ${{ matrix.python.version }} |
42 | | - cache: 'pip' |
43 | | - - run: pip install -e ".[all]" |
| 54 | + path: ${{ env.pythonLocation }} |
| 55 | + key: >- |
| 56 | + ${{ runner.os }}-${{ matrix.python }}-venv-${{ |
| 57 | + hashFiles('pyproject.toml') }}-${{ |
| 58 | + hashFiles('.pre-commit-config.yaml') }} |
| 59 | +
|
| 60 | + - name: Create venv (NEW CACHE) |
| 61 | + if: steps.cache-venv.outputs.cache-hit != 'true' |
| 62 | + run: | |
| 63 | + python --version |
| 64 | + pip install -e ".[all]" |
| 65 | +
|
44 | 66 | - run: codespell |
45 | | - - run: pylint --recursive=y examples pymodbus test |
46 | | - - run: pre-commit run --all-files |
| 67 | + if: matrix.run_doc == true |
| 68 | + |
47 | 69 | - run: cd doc; ./build_html |
48 | | - - run: mypy pymodbus |
| 70 | + if: matrix.run_doc == true |
49 | 71 |
|
50 | | - integreation_test: |
51 | | - name: pytest - ${{ matrix.os.on }} - ${{ matrix.python.version }} |
52 | | - runs-on: ${{ matrix.os.on }} |
53 | | - timeout-minutes: 20 |
54 | | - strategy: |
55 | | - fail-fast: false |
56 | | - matrix: |
57 | | - os: |
58 | | - - on: ubuntu-latest |
59 | | - - on: macos-latest |
60 | | - - on: windows-latest |
61 | | - python: |
62 | | - - version: '3.8' |
63 | | - - version: '3.9' |
64 | | - - version: '3.10' |
65 | | - - version: '3.11' |
66 | | - - version: '3.12' |
67 | | - steps: |
68 | | - - uses: actions/checkout@v3 |
69 | | - - uses: actions/setup-python@v4 |
70 | | - with: |
71 | | - python-version: ${{ matrix.python.version }} |
72 | | - cache: 'pip' |
73 | | - - run: pip install -e ".[all]" |
| 72 | + - run: pylint --recursive=y examples pymodbus test |
| 73 | + if: matrix.run_lint == true |
74 | 74 |
|
75 | | - - run: pytest -n0 -v --full-trace --timeout=1200 |
| 75 | + - run: mypy pymodbus |
| 76 | + if: matrix.run_lint == true |
76 | 77 |
|
77 | | - analyze: |
78 | | - name: Analyze Python |
79 | | - runs-on: ubuntu-22.04 |
| 78 | + # - name: Linter pre-commit |
| 79 | + # run: pre-commit run --all-files |
80 | 80 |
|
81 | | - steps: |
82 | | - - uses: actions/checkout@v3 |
83 | | - - uses: github/codeql-action/init@v2 |
84 | | - with: |
85 | | - languages: python |
86 | | - - uses: github/codeql-action/autobuild@v2 |
87 | | - - uses: github/codeql-action/analyze@v2 |
| 81 | + #integreation_test: |
| 82 | + # name: pytest - ${{ matrix.os.on }} - ${{ matrix.python.version }} |
| 83 | + # runs-on: ${{ matrix.os.on }} |
| 84 | + # timeout-minutes: 20 |
| 85 | + # strategy: |
| 86 | + # fail-fast: false |
| 87 | + # matrix: |
| 88 | + # os: |
| 89 | + # - on: windows-latest |
| 90 | + # - on: macos-latest |
| 91 | + # - on: ubuntu-latest |
| 92 | + # python: |
| 93 | + # - version: '3.12' |
| 94 | + # - version: '3.11' |
| 95 | + # - version: '3.10' |
| 96 | + # - version: '3.9' |
| 97 | + # - version: '3.8' |
| 98 | + # steps: |
| 99 | + # - uses: actions/[email protected] |
| 100 | + # - uses: actions/setup-python@v4 |
| 101 | + # with: |
| 102 | + # python-version: ${{ matrix.python.version }} |
| 103 | + # - run: pip install -e ".[all]" |
| 104 | + # - run: pytest -n0 -v --full-trace --timeout=1200 |
| 105 | + |
| 106 | + # analyze: |
| 107 | + # name: Analyze Python |
| 108 | + # runs-on: ubuntu-22.04 |
| 109 | + # steps: |
| 110 | + # - uses: actions/checkout@v3 |
| 111 | + # - uses: github/codeql-action/init@v2 |
| 112 | + # with: |
| 113 | + # languages: python |
| 114 | + # - uses: github/codeql-action/autobuild@v2 |
| 115 | + # - uses: github/codeql-action/analyze@v2 |
88 | 116 |
|
89 | 117 | ci_complete: |
90 | 118 | name: ci_complete |
91 | 119 | runs-on: ubuntu-latest |
92 | 120 | needs: |
93 | | - - linters |
94 | | - - analyze |
95 | | - - integreation_test |
| 121 | + # - analyze |
| 122 | + - pymodbus |
| 123 | + # - integreation_test |
96 | 124 | timeout-minutes: 1 |
97 | 125 | steps: |
98 | 126 | - name: Dummy |
|
0 commit comments