Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
janiversen committed Jun 2, 2023
2 parents 844913d + 684083f commit 1b12541
Show file tree
Hide file tree
Showing 185 changed files with 5,479 additions and 11,006 deletions.
112 changes: 60 additions & 52 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,74 +17,72 @@ on:


jobs:
linters:
name: Linters
runs-on: ubuntu-latest
timeout-minutes: 10
strategy:
fail-fast: false
steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Set up python
uses: actions/setup-python@v4
with:
python-version: 3.8

- name: venv restore
id: cache-venv
uses: syphar/restore-virtualenv@v1
with:
requirement_files: requirements.txt

- name: venv create
if: steps.cache-venv.outputs.cache-hit != 'true'
run: pip install -e . -r requirements.txt

- name: codespell
run: codespell

- name: pylint
run: pylint --recursive=y examples pymodbus test

- name: precommit (black, bandit, and ruff)
run: pre-commit run --all-files

- name: docs
run: make -C doc/ html

- name: mypy
run: mypy pymodbus


integreation_test:
name: ${{ matrix.task.name }} - ${{ matrix.os.on }} - ${{ matrix.python.version }}
name: pytest - ${{ matrix.os.on }} - ${{ matrix.python.version }}
runs-on: ${{ matrix.os.on }}
needs: linters
timeout-minutes: 10
strategy:
fail-fast: false
matrix:
task:
- name: pylint
cmd: pylint --recursive=y examples pymodbus test
type: lint
- name: codespell
cmd: codespell
type: lint
- name: bandit
cmd: bandit -r -c bandit.yaml .
type: lint
- name: flake8
cmd: flake8
type: lint
- name: precommit (isort and black)
cmd: pre-commit run --all-files
type: lint
- name: docs
cmd: make -C doc/ html
type: lint
- name: mypy
cmd: mypy pymodbus
type: lint
- name: pytest
cmd: pytest --cov=pymodbus --cov=test --cov-report=term-missing --cov-report=xml -v --full-trace --timeout=20
type: test
os:
- name: Linux
on: ubuntu-latest
lint: 'yes'
- name: Macos
on: macos-latest
lint: 'no'
- name: Windows
on: windows-latest
lint: 'no'
- on: ubuntu-latest
- on: macos-latest
- on: windows-latest
python:
- version: '3.8'
lint: 'yes'
- version: '3.9'
lint: 'no'
- version: '3.10'
lint: 'no'
- version: '3.11'
lint: 'no'
- version: pypy-3.8
lint: 'no'
exclude:
- task:
type: lint
os:
lint: 'no'
- task:
type: lint
python:
lint: 'no'
- os:
name: Macos
on: macos-latest
python:
version: pypy-3.8
- os:
name: Windows
on: windows-latest
python:
version: pypy-3.8
steps:
Expand All @@ -106,5 +104,15 @@ jobs:
if: steps.cache-venv.outputs.cache-hit != 'true'
run: pip install -e . -r requirements.txt

- name: test/lint
run: ${{ matrix.task.cmd }}
- name: pytest
run: pytest --cov=pymodbus --cov=test --cov-report=term-missing --cov-report=xml -v --full-trace --timeout=20

ci_complete:
name: ci_complete
runs-on: ubuntu-latest
needs:
- integreation_test
timeout-minutes: 1
steps:
- name: Dummy
run: ls
33 changes: 0 additions & 33 deletions .github/workflows/clean_cache.yml

This file was deleted.

43 changes: 34 additions & 9 deletions .github/workflows/clean_workflow_runs.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
name: Clean workflow runs
on:
# schedule:
# # Monthly day 1 at 0:35 UTC.
# - cron: '35 0 1 1-12 *'
workflow_dispatch:
inputs:
days:
retain_days:
description: 'retain days (default 14)'
required: false
required: true
default: 14
keeps:
keep_minimum_runs:
description: 'keep minimum runs (default 6)'
required: false
required: true
default: 6
schedule:
# Sunday at 02:35 UTC.
- cron: '35 2 * * 0'

permissions:
actions: write

jobs:
del_runs:
Expand All @@ -23,5 +26,27 @@ jobs:
with:
token: ${{ github.token }}
repository: ${{ github.repository }}
retain_days: ${{ github.events.inputs.days }}
keep_minimum_runs: ${{ github.events.inputs.keeps }}
retain_days: ${{ github.events.inputs.retain_days }}
keep_minimum_runs: ${{ github.events.inputs.keep_minimum_runs }}

clear-cache:
runs-on: ubuntu-latest
steps:
- name: Clear cache
uses: actions/github-script@v6
with:
script: |
console.log("About to clear")
const caches = await github.rest.actions.getActionsCacheList({
owner: context.repo.owner,
repo: context.repo.repo,
})
for (const cache of caches.data.actions_caches) {
console.log(cache)
github.rest.actions.deleteActionsCacheById({
owner: context.repo.owner,
repo: context.repo.repo,
cache_id: cache.id,
})
}
console.log("Clear completed")
24 changes: 24 additions & 0 deletions .github/workflows/lock.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: 'Lock Threads'

on:
schedule:
# Every night at 02:20 UTC.
- cron: '20 2 * * *'
workflow_dispatch:

permissions:
issues: write
pull-requests: write

concurrency:
group: lock

jobs:
action:
runs-on: ubuntu-latest
steps:
- uses: dessant/lock-threads@v4
with:
github-token: ${{ github.token }}
issue-inactive-days: '10'
pr-inactive-days: '10'
27 changes: 0 additions & 27 deletions .github/workflows/publish1.yml.NO_RUN

This file was deleted.

27 changes: 0 additions & 27 deletions .github/workflows/publish2.yml.NO_RUN

This file was deleted.

8 changes: 2 additions & 6 deletions .github/workflows/stale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,11 @@ name: Mark stale issues and pull requests
on:
schedule:
- cron: "30 1 * * *"
workflow_dispatch:

jobs:
stale:

runs-on: ubuntu-latest

steps:
- uses: actions/stale@v3
with:
Expand All @@ -22,9 +21,6 @@ jobs:
days-before-issue-close: 5
days-before-pr-close: 10
stale-issue-label: 'no-issue-activity'
exempt-issue-labels: 'Bug,Enhancements,Investigating,in progress,Documentation Update Required,3.x'
exempt-issue-labels: 'Bug,Enhancements,Investigating'
stale-pr-label: 'no-pr-activity'
exempt-pr-labels: 'IN REVIEW,Reviewing,Draft,in progress,3.x,2.5.0'
remove-stale-when-updated: true
# only-labels: "More Information Required, Not an Issue, question, Won't Do"

23 changes: 13 additions & 10 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,21 +1,24 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
---
default_language_version:
python: python

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.2.0
rev: v4.4.0
hooks:
- id: trailing-whitespace
# - id: end-of-file-fixer
- id: end-of-file-fixer
- id: check-yaml
- id: check-added-large-files
- repo: https://github.com/pycqa/isort
rev: 5.12.0
# run ruff with --fix before black
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: 'v0.0.263'
hooks:
- id: isort
exclude: ^(doc/_build|venv|.venv|.git|pymodbus/client/serial_asyncio)
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
- repo: https://github.com/psf/black
rev: 22.12.0
rev: 23.3.0
hooks:
- id: black
args: [--safe,--quiet]
args: [--safe, --quiet]
files: (examples|pymodbus|test)/
8 changes: 0 additions & 8 deletions .pydevproject

This file was deleted.

Loading

0 comments on commit 1b12541

Please sign in to comment.