11name : CI
22
33on :
4- workflow_dispatch :
5- inputs :
6- run_lint :
7- description : ' Run lint'
8- required : false
9- default : true
10- type : boolean
11- run_test :
12- description : ' Run test'
13- required : false
14- default : true
15- type : boolean
164 push :
175 branches :
186 - dev
2311 branches :
2412 - dev
2513 schedule :
26- # Daily at 02:10 UTC.
27- - cron : ' 10 2 * * *'
14+ # Sunday at 02:10 UTC.
15+ - cron : ' 10 2 * * 0'
16+ workflow_dispatch :
2817
2918
3019jobs :
@@ -37,68 +26,65 @@ jobs:
3726 matrix :
3827 task :
3928 - name : pylint
40- type : lint
4129 cmd : pylint --recursive=y examples pymodbus test
42- - name : codespell
4330 type : lint
31+ - name : codespell
4432 cmd : codespell
45- - name : bandit
4633 type : lint
34+ - name : bandit
4735 cmd : bandit -r -c bandit.yaml .
48- - name : flake8
4936 type : lint
37+ - name : flake8
5038 cmd : flake8
51- - name : isort
5239 type : lint
40+ - name : isort
5341 cmd : isort --check .
54- - name : black
5542 type : lint
43+ - name : black
5644 cmd : black --check --safe --quiet examples/ pymodbus/ test/
57- - name : docs
5845 type : lint
46+ - name : docs
5947 cmd : make -C doc/ html
48+ type : lint
6049 - name : pytest
61- type : test
6250 cmd : pytest --cov=pymodbus --cov=test --cov-report=term-missing --cov-report=xml -v --full-trace --timeout=20
51+ type : test
6352 os :
64- - on : ubuntu-latest
65- activate : ' . venv/bin/activate'
66- - on : macos-latest
67- activate : ' . venv/bin/activate'
68- no-lint : ' yes'
69- - on : windows-latest
70- activate : ' venv/Scripts/activate'
71- no-lint : ' yes'
53+ - name : Linux
54+ on : ubuntu-latest
55+ lint : ' yes'
56+ - name : Macos
57+ on : macos-latest
58+ lint : ' no'
59+ - name : Windows
60+ on : windows-latest
61+ lint : ' no'
7262 python :
7363 - version : ' 3.8'
74- no- lint : ' no '
64+ lint : ' yes '
7565 - version : ' 3.9'
76- no- lint : ' yes '
66+ lint : ' no '
7767 - version : ' 3.10'
78- no- lint : ' yes '
68+ lint : ' no '
7969 - version : pypy-3.8
80- implementation : pypy
81- no-lint : ' yes'
82- - version : pypy-3.9
83- implementation : pypy
84- no-lint : ' yes'
70+ lint : ' no'
8571 exclude :
8672 - task :
8773 type : lint
8874 os :
89- no- lint : ' yes '
75+ lint : ' no '
9076 - task :
9177 type : lint
9278 python :
93- no- lint : ' yes '
79+ lint : ' no '
9480 - os :
95- on : macos-latest
81+ name : Macos
9682 python :
97- implementation : pypy
83+ version : pypy-3.8
9884 - os :
99- on : windows-latest
85+ name : Windows
10086 python :
101- implementation : pypy
87+ version : pypy-3.8
10288 steps :
10389 - name : Checkout repository
10490 uses : actions/checkout@v3
@@ -110,36 +96,13 @@ jobs:
11096
11197 - name : venv restore
11298 id : cache-venv
113- uses : actions/cache@v3
99+ uses : syphar/restore-virtualenv@v1
114100 with :
115- path : venv
116- key : " venv_${{ matrix.os.on }}_${{ matrix.python.version }}_${{ hashFiles('requirements.txt') }}"
101+ requirement_files : requirements.txt
117102
118103 - name : venv create
119- if : ${{ steps.cache-venv.outputs.cache-hit != 'true' }}
120- run : |
121- python -m venv venv
122- ${{ matrix.os.activate }}
123- pip install -e . -r requirements.txt
124-
125- - name : test
126- if : ${{ matrix.task.type == 'test' && inputs.run_test }}
127- run : |
128- ${{ matrix.os.activate }}
129- ${{ matrix.task.cmd }}
104+ if : steps.cache-venv.outputs.cache-hit != 'true'
105+ run : pip install -e . -r requirements.txt
130106
131- - name : lint
132- if : ${{ matrix.task.type == 'lint' && inputs.run_lint }}
133- run : |
134- ${{ matrix.os.activate }}
135- ${{ matrix.task.cmd }}
136-
137- all :
138- name : All
139- runs-on : ubuntu-latest
140- needs :
141- - integreation_test
142- steps :
143- - name : This
144- run : |
145- ls -l
107+ - name : test/lint
108+ run : ${{ matrix.task.cmd }}
0 commit comments