Skip to content

Commit

Permalink
update tools / CI
Browse files Browse the repository at this point in the history
  • Loading branch information
grizz committed Apr 28, 2024
1 parent 1e4ff9a commit 4c9c59e
Show file tree
Hide file tree
Showing 6 changed files with 54 additions and 154 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Install virtualenv from poetry
uses: 20c/workflows/poetry@v1
- name: deploy mkdocs gh-pages site
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,18 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Log in to the Container registry
uses: docker/login-action@v1
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v3
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
Expand All @@ -47,7 +47,7 @@ jobs:
type=sha
- name: Build and push container image
uses: docker/build-push-action@v2
uses: docker/build-push-action@v5
with:
context: .
push: true
Expand Down
16 changes: 6 additions & 10 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
linting:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Install virtualenv from poetry
uses: 20c/workflows/poetry@v1
- name: Run linters
Expand All @@ -24,31 +24,27 @@ jobs:
runs-on: ${{ matrix.os }}
steps:
- name: Check out repository
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Install requirements
run: sudo apt-get install rrdtool librrd-dev fping traceroute
- name: Install virtualenv from poetry
uses: grizz/workflows/poetry@v1
uses: 20c/workflows/poetry@v1
with:
python-version: ${{ matrix.python-version }}
install-options: -Eall
- name: Run tests
run: |
poetry run pytest -vv --cov-report=term-missing --cov=${{ github.event.repository.name }} --cov-report=xml tests/
poetry run coverage report
run: poetry run tox -e py
# upload coverage stats
- name: Upload coverage
uses: codecov/codecov-action@v1
uses: codecov/codecov-action@v3
with:
file: ./coverage.xml
fail_ci_if_error: true


test_container:
needs: test
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: run tests against tester
run: ./Ctl/ci/run.sh vaping pytest -vv tests/
36 changes: 12 additions & 24 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,37 +5,25 @@ exclude: |
)$
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v4.6.0
hooks:
- id: check-toml
- id: check-yaml
- id: trailing-whitespace
- repo: local
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.1.14
hooks:
- id: system
name: isort
entry: poetry run isort .
language: system
pass_filenames: false
# Run the linter.
- id: ruff
args: [--fix]
# Run the formatter.
- id: ruff-format
- repo: local
hooks:
- id: pyupgrade
- id: pyupgrade
name: pyupgrade
entry: poetry run pyupgrade --py36-plus
entry: poetry run pyupgrade --py38-plus
language: python
types: [python]
pass_filenames: true
- repo: local
hooks:
- id: system
name: Black
entry: poetry run black .
language: system
pass_filenames: false
- repo: local
hooks:
- id: system
name: flake8
entry: poetry run flake8 .
language: system
pass_filenames: false
pass_filenames: true
137 changes: 27 additions & 110 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 4 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ python = "^3.8"
pid = ">=3"
pluginmgr = ">=1"
python-daemon = ">=2"
# Package docutils (0.21.post1) not found.
docutils = "<=0.21"
munge = { extras = ["tomlkit", "yaml"], version = ">=1.2.0" }
confu = ">=1.7.1"
Expand Down Expand Up @@ -72,12 +73,10 @@ pytest-filedata = "^0.4.0"
tox = ">=3.20.1"

# linting
black = ">=20"
isort = ">=5.7.0"
flake8 = ">=3.8.4"
ruff = ">=0.1"
mypy = ">=0.950"
pre-commit = ">=2.13"
pyupgrade = ">=2.19.4"
mypy = ">=0.812"
pyupgrade = ">=2.19"

# ctl
ctl = ">=1"
Expand Down

0 comments on commit 4c9c59e

Please sign in to comment.