Skip to content

Commit 795b308

Browse files
authored
Used tooled python and OS (#1232)
Used tooled python and OS.
1 parent 8b38047 commit 795b308

File tree

2 files changed

+35
-74
lines changed

2 files changed

+35
-74
lines changed

.github/workflows/ci.yml

Lines changed: 33 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,15 @@ on:
2222
pull_request:
2323
branches:
2424
- dev
25+
schedule:
26+
# Daily at 02:10 UTC.
27+
- cron: '10 2 * * *'
2528

2629

2730
jobs:
2831
integreation_test:
29-
name: ${{ matrix.task.name }} - ${{ matrix.os.name }} ${{ matrix.python.name }}
30-
runs-on: ${{ matrix.os.runs-on }}
31-
container: ${{ matrix.os.container[matrix.python.docker] }}
32+
name: ${{ matrix.task.name }} - ${{ matrix.os.on }} - ${{ matrix.python.version }}
33+
runs-on: ${{ matrix.os.on }}
3234
timeout-minutes: 10
3335
strategy:
3436
fail-fast: false
@@ -59,110 +61,69 @@ jobs:
5961
type: test
6062
cmd: pytest --cov=pymodbus --cov=test --cov-report=term-missing --cov-report=xml -v --full-trace --timeout=20
6163
os:
62-
- name: Linux
63-
runs-on: ubuntu-latest
64+
- on: ubuntu-latest
6465
activate: '. venv/bin/activate'
65-
container:
66-
3.8: docker://python:3.8-buster
67-
3.9: docker://python:3.9-buster
68-
3.10: docker://python:3.10-buster
69-
pypy3: docker://pypy:3-stretch
70-
- name: macOS
71-
runs-on: macos-latest
66+
- on: macos-latest
7267
activate: '. venv/bin/activate'
73-
- name: Windows
74-
runs-on: windows-latest
68+
no-lint: 'yes'
69+
- on: windows-latest
7570
activate: 'venv/Scripts/activate'
76-
ports: 5020-5099
71+
no-lint: 'yes'
7772
python:
78-
- name: CPython 3.8
79-
action: 3.8
80-
docker: 3.8
81-
matrix: 3.8
82-
implementation: cpython
83-
- name: CPython 3.9
84-
action: 3.9
85-
docker: 3.9
86-
matrix: 3.9
87-
implementation: cpython
88-
- name: 'CPython 3.10'
89-
action: '3.10'
90-
docker: '3.10'
91-
matrix: '3.10'
92-
implementation: cpython
93-
- name: PyPy 3.8
94-
action: pypy-3.8
95-
docker: pypy3.8
96-
matrix: 3.8
73+
- version: '3.8'
74+
no-lint: 'no'
75+
- version: '3.9'
76+
no-lint: 'yes'
77+
- version: '3.10'
78+
no-lint: 'yes'
79+
- version: pypy-3.8
9780
implementation: pypy
98-
- name: PyPy 3.9
99-
action: pypy-3.9
100-
docker: pypy3.9
101-
matrix: 3.9
81+
no-lint: 'yes'
82+
- version: pypy-3.9
10283
implementation: pypy
84+
no-lint: 'yes'
10385
exclude:
10486
- task:
10587
type: lint
10688
os:
107-
name: macOS
108-
- task:
109-
type: lint
110-
os:
111-
name: Windows
89+
no-lint: 'yes'
11290
- task:
11391
type: lint
11492
python:
115-
matrix: 3.9
116-
- task:
117-
type: lint
118-
python:
119-
matrix: '3.10'
120-
- task:
121-
type: lint
93+
no-lint: 'yes'
94+
- os:
95+
on: macos-latest
12296
python:
12397
implementation: pypy
124-
- python:
125-
implementation: pypy
126-
os:
127-
name: macOS
128-
- python:
98+
- os:
99+
on: windows-latest
100+
python:
129101
implementation: pypy
130-
os:
131-
name: Windows
132102
steps:
133103
- name: Checkout repository
134104
uses: actions/checkout@v3
135105

136-
- name: Set up ${{ matrix.python.name }} (if CPython)
137-
if: ${{ job.container == '' && matrix.python.implementation == 'cpython' }}
138-
uses: actions/setup-python@v3
139-
with:
140-
python-version: '${{ matrix.python.action }}.0-alpha - ${{ matrix.python.action }}.X'
141-
check-latest: true
142-
143-
- name: Set up ${{ matrix.python.name }} (if PyPy)
144-
if: ${{ job.container == '' && matrix.python.implementation == 'pypy' }}
145-
uses: actions/setup-python@v3
106+
- name: Set up ${{ matrix.python.version }}
107+
uses: actions/setup-python@v4
146108
with:
147-
python-version: '${{ matrix.python.action }}'
148-
check-latest: true
109+
python-version: ${{ matrix.python.version }}
149110

150111
- name: venv restore
151112
id: cache-venv
152113
uses: actions/cache@v3
153114
with:
154115
path: venv
155-
key: "venv_${{ matrix.os.name }}_${{ matrix.python.name }}_${{ hashFiles('requirements.txt') }}"
116+
key: "venv_${{ matrix.os.on }}_${{ matrix.python.version }}_${{ hashFiles('requirements.txt') }}"
156117

157118
- name: venv create
158119
if: ${{ steps.cache-venv.outputs.cache-hit != 'true' }}
159120
run: |
160121
python -m venv venv
161122
${{ matrix.os.activate }}
162-
pip install -r requirements.txt
163-
pip install -e .
123+
pip install -e . -r requirements.txt
164124
165125
- name: test
126+
if: ${{ matrix.task.type == 'test' && inputs.run_test }}
166127
run: |
167128
${{ matrix.os.activate }}
168129
${{ matrix.task.cmd }}

.github/workflows/clean_workflow_runs.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ on:
1111
required: false
1212
default: 6
1313
schedule:
14-
# Sundays at 01:35 UTC.
15-
- cron: '35 1 * * 0'
14+
# Daily at 02:35 UTC.
15+
- cron: '35 2 * * *'
1616

1717
jobs:
1818
del_runs:

0 commit comments

Comments
 (0)