diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 04c9146..a629e3e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,8 +13,38 @@ defaults: working-directory: "ansible-role-tenable-agent" jobs: + lint: + name: Lint + runs-on: ubuntu-latest + steps: + - name: Check out the codebase. + uses: actions/checkout@v3.3.0 + with: + path: "ansible-role-tenable-agent" + + - name: πŸš€ Setup Python + uses: actions/setup-python@v4 + with: + python-version: "3.11" + cache: "pipenv" + + - name: ⏬ Install OS dependencies + run: sudo apt-get update && sudo apt-get install -y libcurl4-openssl-dev + + - name: ⏬ Install pipenv and dependencies + run: | + python -m pip install --upgrade pipenv wheel + pipenv install + + - name: πŸƒ Lint / Python + run: pipenv run flake8 *.py --ignore=E501,W503 + + - name: πŸƒ Lint / Markdown + run: pipenv run pymarkdownlnt --disable-rules MD013 scan . + molecule: name: Molecule + needs: lint runs-on: ubuntu-latest strategy: matrix: @@ -37,15 +67,15 @@ jobs: python-version: "3.11" cache: "pipenv" - - name: Install OS dependencies + - name: ⏬ Install OS dependencies run: sudo apt-get update && sudo apt-get install -y libcurl4-openssl-dev - - name: ⏬ Install pipenv and dependencies + - name: ⏬Install pipenv and dependencies run: | python -m pip install --upgrade pipenv wheel pipenv install - - name: Run Molecule tests. + - name: πŸƒ Run Molecule tests. run: pipenv run molecule test env: PY_COLORS: "1" diff --git a/Pipfile b/Pipfile index 8f6223c..beb82b1 100644 --- a/Pipfile +++ b/Pipfile @@ -13,6 +13,8 @@ molecule = {extras = ["docker"], version = "*"} docker = "*" molecule-hetznercloud = "*" hcloud = "*" +flake8 = "*" +pymarkdownlnt = "*" [dev-packages] diff --git a/Pipfile.lock b/Pipfile.lock index a87bbbe..1b79d08 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -1,7 +1,7 @@ { "_meta": { "hash": { - "sha256": "41096a94c160ebc9a7e26cc2762a142661ceaf9d9c2b63007e5669bcadc92e69" + "sha256": "2170d98d9fed6ab82fdb12c4de9fe777e07b3b6b19123677f2199199102fd360" }, "pipfile-spec": 6, "requires": { @@ -49,6 +49,14 @@ "index": "pypi", "version": "==6.14.2" }, + "application-properties": { + "hashes": [ + "sha256:2172fe240b377ac8948c6a6492c3063722dc5dbbd00456092491688a5d95672e", + "sha256:c1fc3c8775a0337d2d8c5268fd4a9b4fed22bc4396e7ce17ad0a5c5463355217" + ], + "markers": "python_full_version >= '3.8.0'", + "version": "==0.5.2" + }, "arrow": { "hashes": [ "sha256:3934b30ca1b9f292376d9db15b19446088d12ec58629bc3f0da28fd55fb633a1", @@ -341,6 +349,13 @@ ], "version": "==0.9.1" }, + "columnar": { + "hashes": [ + "sha256:8efb692a7e6ca07dcc8f4ea889960421331a5dffa8e5af81f0a67ad8ea1fc798", + "sha256:c3cb57273333b2ff9cfaafc86f09307419330c97faa88dcfe23df05e6fbb9c72" + ], + "version": "==1.4.1" + }, "cookiecutter": { "hashes": [ "sha256:9f3ab027cec4f70916e28f03470bdb41e637a3ad354b4d65c765d93aad160022", @@ -402,6 +417,14 @@ "markers": "python_version >= '3.7'", "version": "==3.10.0" }, + "flake8": { + "hashes": [ + "sha256:3833794e27ff64ea4e9cf5d410082a8b97ff1a06c16aa3d2027339cd0f1195c7", + "sha256:c61007e76655af75e6785a931f452915b371dc48f56efd765247c8fe68f2b181" + ], + "index": "pypi", + "version": "==6.0.0" + }, "hcloud": { "hashes": [ "sha256:37bd5ba56387e3c491c5babd3e08ab91d5f0390cd5e880e4dfea19e21681bc9e", @@ -512,6 +535,14 @@ "markers": "python_version >= '3.7'", "version": "==2.1.2" }, + "mccabe": { + "hashes": [ + "sha256:348e0240c33b60bbdf4e523192ef919f28cb2c3d7d5c7794f74009290f236325", + "sha256:6c2d30ab6be0e4a46919781807b4f0d834ebdd6c6e3dca0bda5a15f863427b6e" + ], + "markers": "python_version >= '3.6'", + "version": "==0.7.0" + }, "mdurl": { "hashes": [ "sha256:84008a41e51615a49fc9966191ff91509e3c40b939176e643fd50a5c2196b8f8", @@ -593,6 +624,14 @@ "markers": "python_version >= '3.6'", "version": "==1.0.0" }, + "pycodestyle": { + "hashes": [ + "sha256:347187bdb476329d98f695c213d7295a846d1152ff4fe9bacb8a9590b8ee7053", + "sha256:8a4eaf0d0495c7395bdab3589ac2db602797d76207242c17d470186815706610" + ], + "markers": "python_version >= '3.6'", + "version": "==2.10.0" + }, "pycparser": { "hashes": [ "sha256:8ee45429555515e1f6b185e78100aea234072576aa43ab53aefcae078162fca9", @@ -607,6 +646,14 @@ "markers": "python_version >= '3.5'", "version": "==7.45.2" }, + "pyflakes": { + "hashes": [ + "sha256:ec55bf7fe21fff7f1ad2f7da62363d749e2a470500eab1b555334b67aa1ef8cf", + "sha256:ec8b276a6b60bd80defed25add7e439881c19e64850afd9b346283d4165fd0fd" + ], + "markers": "python_version >= '3.6'", + "version": "==3.0.1" + }, "pygments": { "hashes": [ "sha256:b3ed06a9e8ac9a9aae5a6f5dbe78a8a58655d17b43b93c078f094ddc476ae297", @@ -615,6 +662,14 @@ "markers": "python_version >= '3.6'", "version": "==2.14.0" }, + "pymarkdownlnt": { + "hashes": [ + "sha256:6e17d28c530b33e3faa52b87fd91bf43bbe26c8d7cbe0f14667806745d48bff6", + "sha256:b243a3e61f40ac06364bb6761614d34cb72753a2598a7eb9dbaa0981d3061508" + ], + "index": "pypi", + "version": "==0.9.9" + }, "pynacl": { "hashes": [ "sha256:06b8f6fa7f5de8d5d2f7573fe8c863c051225a27b61e6860fd047b1775807858", @@ -785,6 +840,22 @@ ], "version": "==1.3" }, + "toolz": { + "hashes": [ + "sha256:2059bd4148deb1884bb0eb770a3cde70e7f954cfbbdc2285f1f2de01fd21eb6f", + "sha256:88c570861c440ee3f2f6037c4654613228ff40c93a6c25e0eba70d17282c6194" + ], + "markers": "python_version >= '3.5'", + "version": "==0.12.0" + }, + "typing-extensions": { + "hashes": [ + "sha256:1511434bb92bf8dd198c12b1cc812e800d4181cfcb867674e0f8279cc93087aa", + "sha256:16fa4864408f655d35ec496218b85f79b3437c829e93320c7c9215ccfd92489e" + ], + "markers": "python_version >= '3.7'", + "version": "==4.4.0" + }, "urllib3": { "hashes": [ "sha256:8a388717b9476f934a21484e8c8e61875ab60644d29b9b39e11e4b9dc1c6b305", @@ -801,6 +872,13 @@ "markers": "python_version >= '3.7'", "version": "==8.4.1" }, + "wcwidth": { + "hashes": [ + "sha256:795b138f6875577cd91bba52baf9e445cd5118fd32723b460e30a0af30ea230e", + "sha256:a5220780a404dbe3353789870978e472cfe477761f06ee55077256e509b156d0" + ], + "version": "==0.2.6" + }, "websocket-client": { "hashes": [ "sha256:3f09e6d8230892547132177f575a4e3e73cfdf06526e20cc02aa1c3b47184d40", diff --git a/README.md b/README.md index c0fdb74..5a4b674 100644 --- a/README.md +++ b/README.md @@ -16,8 +16,8 @@ Ansible role for installing and configuring Nessus Agent _NOTE:_ The Tenable download URLs are not static and they will change. To automatically generate a new list, run -``` -$ get-package-urls.py >vars/package_url.yaml +```sh +get-package-urls.py >vars/package_url.yaml ``` ## Dependencies