Skip to content

Commit

Permalink
Changes for CI tests (#1233)
Browse files Browse the repository at this point in the history
  • Loading branch information
joachimmetz committed Apr 14, 2024
1 parent 429f960 commit fc42c45
Show file tree
Hide file tree
Showing 16 changed files with 71 additions and 49 deletions.
39 changes: 14 additions & 25 deletions .github/workflows/test_docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,18 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
version: ['38']
version: ['39', '40']
container:
image: registry.fedoraproject.org/fedora:${{ matrix.version }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up container
run: |
dnf install -y dnf-plugins-core langpacks-en
- name: Install dependencies
run: |
dnf copr -y enable @gift/dev
dnf install -y @development-tools python3 python3-devel python3-setuptools
dnf install -y @development-tools python3 python3-build python3-devel python3-setuptools python3-wheel
- name: Run tests
env:
LANG: C.utf8
Expand All @@ -27,25 +27,21 @@ jobs:
- name: Run end-to-end tests
run: |
if test -f tests/end-to-end.py; then PYTHONPATH=. python3 ./tests/end-to-end.py --debug -c config/end-to-end.ini; fi
- name: Build source distribution
- name: Build source distribution (sdist)
run: |
python3 ./setup.py sdist
- name: Build binary distribution
python3 -m build --no-isolation --sdist
- name: Build binary distribution (wheel)
run: |
python3 ./setup.py bdist
- name: Run build and install test
run: |
python3 ./setup.py build
python3 ./setup.py install
python3 -m build --no-isolation --wheel
test_ubuntu:
runs-on: ubuntu-latest
strategy:
matrix:
version: ['22.04']
version: ['24.04']
container:
image: ubuntu:${{ matrix.version }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up container
env:
DEBIAN_FRONTEND: noninteractive
Expand All @@ -58,7 +54,7 @@ jobs:
run: |
add-apt-repository -y ppa:gift/dev
apt-get update -q
apt-get install -y build-essential python3 python3-dev python3-distutils python3-pip python3-setuptools python3-wheel
apt-get install -y build-essential python3 python3-build python3-dev python3-pip python3-setuptools python3-wheel
- name: Run tests
env:
LANG: en_US.UTF-8
Expand All @@ -69,16 +65,9 @@ jobs:
LANG: en_US.UTF-8
run: |
if test -f tests/end-to-end.py; then PYTHONPATH=. python3 ./tests/end-to-end.py --debug -c config/end-to-end.ini; fi
- name: Update setuptools
run: |
python3 -m pip install -U setuptools
- name: Build source distribution
run: |
python3 ./setup.py sdist
- name: Build binary distribution
- name: Build source distribution (sdist)
run: |
python3 ./setup.py bdist
- name: Run build and install test
python3 -m build --no-isolation --sdist
- name: Build binary distribution (wheel)
run: |
python3 ./setup.py build
python3 ./setup.py install
python3 -m build --no-isolation --wheel
16 changes: 9 additions & 7 deletions .github/workflows/test_tox.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
container:
image: ubuntu:22.04
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up container
env:
DEBIAN_FRONTEND: noninteractive
Expand All @@ -44,7 +44,7 @@ jobs:
add-apt-repository -y ppa:deadsnakes/ppa
add-apt-repository -y ppa:gift/dev
apt-get update -q
apt-get install -y build-essential git python${{ matrix.python-version }} python${{ matrix.python-version }}-dev python${{ matrix.python-version }}-venv python3-distutils python3-pip python3-setuptools
apt-get install -y build-essential git python${{ matrix.python-version }} python${{ matrix.python-version }}-dev python${{ matrix.python-version }}-venv python3-distutils python3-lib2to3 python3-pip python3-setuptools
- name: Install tox
run: |
python3 -m pip install tox
Expand All @@ -63,7 +63,7 @@ jobs:
container:
image: ubuntu:22.04
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up container
env:
DEBIAN_FRONTEND: noninteractive
Expand All @@ -80,7 +80,7 @@ jobs:
add-apt-repository -y ppa:deadsnakes/ppa
add-apt-repository -y ppa:gift/dev
apt-get update -q
apt-get install -y build-essential git python${{ matrix.python-version }} python${{ matrix.python-version }}-dev python${{ matrix.python-version }}-venv python3-distutils python3-pip python3-setuptools
apt-get install -y build-essential git python${{ matrix.python-version }} python${{ matrix.python-version }}-dev python${{ matrix.python-version }}-venv python3-distutils python3-lib2to3 python3-pip python3-setuptools
- name: Install tox
run: |
python3 -m pip install tox
Expand All @@ -90,7 +90,9 @@ jobs:
run: |
tox -e${{ matrix.toxenv }}
- name: Upload coverage report to Codecov
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
lint:
runs-on: ubuntu-latest
strategy:
Expand All @@ -101,7 +103,7 @@ jobs:
container:
image: ubuntu:22.04
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up container
env:
DEBIAN_FRONTEND: noninteractive
Expand All @@ -118,7 +120,7 @@ jobs:
add-apt-repository -y ppa:deadsnakes/ppa
add-apt-repository -y ppa:gift/dev
apt-get update -q
apt-get install -y build-essential git python${{ matrix.python-version }} python${{ matrix.python-version }}-dev python${{ matrix.python-version }}-venv python3-distutils python3-pip python3-setuptools
apt-get install -y build-essential git python${{ matrix.python-version }} python${{ matrix.python-version }}-dev python${{ matrix.python-version }}-venv python3-distutils python3-lib2to3 python3-pip python3-setuptools
- name: Install tox
run: |
python3 -m pip install tox
Expand Down
8 changes: 8 additions & 0 deletions .yamllint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
extends: default

rules:
line-length: disable
indentation:
spaces: consistent
indent-sequences: false
check-multi-line-strings: true
4 changes: 2 additions & 2 deletions data/presets.ini
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ presets: dfvfs,dfwinreg
projects: artifacts,dfimagetools

[dfvfs]
projects: cffi,dfdatetime,dfvfs,dtfabric,idna,libcaes,libbde,libewf,libfcrypto,libfsapfs,libfsext,libfsfat,libfshfs,libfsntfs,libfsxfs,libfvde,libfwnt,libgzipf,libluksde,libmodi,libphdi,libqcow,libsigscan,libsmdev,libsmraw,libvhdi,libvmdk,libvsapm,libvsbsdl,libvsgpt,libvshadow,libvslvm,mock,pbr,pytsk3,PyYAML,xattr
projects: cffi,dfdatetime,dfvfs,dtfabric,libcaes,libbde,libewf,libfcrypto,libfsapfs,libfsext,libfsfat,libfshfs,libfsntfs,libfsxfs,libfvde,libfwnt,libgzipf,libluksde,libmodi,libphdi,libqcow,libsigscan,libsmdev,libsmraw,libvhdi,libvmdk,libvsapm,libvsbsdl,libvsgpt,libvshadow,libvslvm,mock,pbr,pytsk3,PyYAML,xattr

[dfwinreg]
projects: dfdatetime,dfwinreg,dtfabric,libcreg,libregf,mock,pbr,PyYAML
Expand All @@ -29,7 +29,7 @@ projects: libbde,libcaes,libcdata,libcdatetime,libcdirectory,libcerror,libcfile,

[plaso]
presets: dfimagetools,redis-py
projects: acstore,bencode,certifi,cffi,chardet,dateutil,defusedxml,fakeredis,Flor,libcaes,libesedb,libevt,libevtx,libexe,libfwps,libfwsi,liblnk,libmsiecf,libolecf,libscca,mock,opensearch-py,pbr,pefile,plaso,psutil,pyparsing,python-lz4,python-zstd,pytz,pyzmq,requests,urllib3,XlsxWriter,yara-python
projects: acstore,bencode,certifi,cffi,chardet,dateutil,defusedxml,fakeredis,Flor,idna,libcaes,libesedb,libevt,libevtx,libexe,libfwps,libfwsi,liblnk,libmsiecf,libolecf,libscca,mock,opensearch-py,pbr,pefile,plaso,psutil,pyparsing,python-lz4,python-zstd,pytz,pyzmq,requests,urllib3,XlsxWriter,yara-python

[redis-py]
projects: deprecated,importlib-metadata,redis-py
Expand Down
4 changes: 2 additions & 2 deletions data/templates/github_actions/test_docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
container:
image: registry.fedoraproject.org/fedora:$${{ matrix.version }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up container
run: |
dnf install -y dnf-plugins-core langpacks-en
Expand Down Expand Up @@ -41,7 +41,7 @@ jobs:
container:
image: ubuntu:$${{ matrix.version }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up container
env:
DEBIAN_FRONTEND: noninteractive
Expand Down
2 changes: 1 addition & 1 deletion data/templates/github_actions/test_docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
container:
image: ubuntu:22.04
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up container
env:
DEBIAN_FRONTEND: noninteractive
Expand Down
10 changes: 6 additions & 4 deletions data/templates/github_actions/test_tox.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
container:
image: ubuntu:22.04
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up container
env:
DEBIAN_FRONTEND: noninteractive
Expand Down Expand Up @@ -63,7 +63,7 @@ jobs:
container:
image: ubuntu:22.04
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up container
env:
DEBIAN_FRONTEND: noninteractive
Expand All @@ -90,7 +90,9 @@ jobs:
run: |
tox -e$${{ matrix.toxenv }}
- name: Upload coverage report to Codecov
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v4
with:
token: $${{ secrets.CODECOV_TOKEN }}
lint:
runs-on: ubuntu-latest
strategy:
Expand All @@ -101,7 +103,7 @@ jobs:
container:
image: ubuntu:22.04
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up container
env:
DEBIAN_FRONTEND: noninteractive
Expand Down
2 changes: 1 addition & 1 deletion l2tdevtools/build_helpers/dpkg.py
Original file line number Diff line number Diff line change
Expand Up @@ -763,7 +763,7 @@ class PybuildDPKGBuildHelperBase(DPKGBuildHelper):
"""Shared functionality for dh-pybuild build system dpkg build helpers."""

def _DetermineBuildConfiguration(self, source_directory):
"""Determines the build configuration of a project that has setup.py
"""Determines the build configuration of a project that has setup.py.
Args:
source_directory (str): path of the source directory.
Expand Down
7 changes: 7 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
[build-system]
requires = ["setuptools", "wheel"]
build-backend = "setuptools.build_meta"

[tool.docformatter]
black = false
non-cap = ["dfDateTime", "dfImageTools", "dfVFS", "dfWinReg", "dtFabric", "iMessage", "iOS", "iPod", "mDNS"]
non-strict = false
wrap-summaries = 80
wrap-descriptions = 80
2 changes: 1 addition & 1 deletion tests/helpers/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@


class ProjectHelperTest(test_lib.BaseTestCase):
"""Tests the project helper"""
"""Tests the project helper."""

# pylint: disable=protected-access

Expand Down
2 changes: 1 addition & 1 deletion tests/review_helpers/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@


class CLIHelperTest(test_lib.BaseTestCase):
"""Tests the command line helper"""
"""Tests the command line helper."""

def testRunCommand(self):
"""Tests that the helper can be initialized."""
Expand Down
2 changes: 1 addition & 1 deletion tests/review_helpers/git.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@


class GitHelperTest(test_lib.BaseTestCase):
"""Tests the git helper"""
"""Tests the git helper."""

def testInitialize(self):
"""Tests that the helper can be initialized."""
Expand Down
2 changes: 1 addition & 1 deletion tests/review_helpers/github.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@


class GitHubHelperTest(shared_test_lib.BaseTestCase):
"""Tests the command line helper"""
"""Tests the command line helper."""

# pylint: disable=protected-access

Expand Down
2 changes: 1 addition & 1 deletion tests/review_helpers/pylint.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@


class PylintHelperTest(test_lib.BaseTestCase):
"""Tests the pylint helper"""
"""Tests the pylint helper."""

# pylint: disable=protected-access

Expand Down
2 changes: 1 addition & 1 deletion tests/review_helpers/review.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@


class ReviewHelperTest(test_lib.BaseTestCase):
"""Tests the review helper"""
"""Tests the review helper."""

def testInitialize(self):
"""Tests that the helper can be initialized."""
Expand Down
16 changes: 15 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
envlist = py3{8,9,10,11,12},coverage,lint,wheel
envlist = py3{8,9,10,11,12},coverage,docformatter,lint,wheel

[testenv]
allowlist_externals = ./run_tests.py
Expand All @@ -25,6 +25,13 @@ commands =
coverage: coverage xml
wheel: python -m build --no-isolation --wheel

[testenv:docformatter]
usedevelop = True
deps =
docformatter
commands =
docformatter --in-place --recursive l2tdevtools tests

[testenv:lint]
skipsdist = True
pip_pre = True
Expand All @@ -37,7 +44,14 @@ setenv =
deps =
-rrequirements.txt
-rtest_requirements.txt
docformatter
pylint >= 3.0.0, < 3.1.0
setuptools
yamllint >= 1.26.0
commands =
docformatter --version
pylint --version
yamllint -v
docformatter --check --diff --recursive l2tdevtools setup.py tests tools
pylint --rcfile=.pylintrc l2tdevtools setup.py tests tools
yamllint -c .yamllint.yaml data

0 comments on commit fc42c45

Please sign in to comment.