Skip to content

Commit

Permalink
with lint
Browse files Browse the repository at this point in the history
  • Loading branch information
szachovy committed Jun 26, 2024
1 parent b28018b commit 4c604e7
Show file tree
Hide file tree
Showing 7 changed files with 66 additions and 37 deletions.
63 changes: 63 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@

name: Lint

on:
push:
branches: '**'

jobs:
lint:
runs-on: self-hosted
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup Python
uses: actions/setup-python@v3
with:
python-version: "3.10.12"

- name: Install Python dependencies
run: pip install --no-cache-dir --user pylint mypy flake8

- name: Setup Terraform linter
uses: terraform-linters/setup-tflint@v4
with:
tflint_version: v0.50.3

- name: Initialize Terraform linter
run: tflint --init
working-directory: ./tests/setup
env:
GITHUB_TOKEN: ${{ github.token }}

- name: Lint Markdown files
uses: articulate/actions-markdownlint@v1
with:
files: '**/*.md'
ignore: node_modules
version: 0.28.1

- name: Lint shell scripts
uses: ludeeus/action-shellcheck@master

- name: Lint Dockerfiles
uses: hadolint/[email protected]
with:
dockerfile: Dockerfile

- name: Lint Terraform testing infrastructure
run: tflint
working-directory: ./tests/setup

- name: Lint ansible testing playbook
uses: ansible/ansible-lint@main

- name: Lint Python files with pylint
run: pylint **/*.py

- name: Lint Python files with mypy
run: mypy .

- name: Lint Python files with flake8
run: flake8 .
2 changes: 0 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ jobs:
run: |
sudo apt update
sudo apt install --yes openssh-server=1:8.9p1-3ubuntu0.7
sudo apt install --yes tree
sudo service ssh start
- name: Initialize Terraform infrastructure
Expand All @@ -37,7 +36,6 @@ jobs:

- name: Show VM metrics
run: cat /proc/cpuinfo && cat /proc/meminfo && df -h
# && du -h --max-depth=3 / | sort -rh | head -n 100

- name: Apply Terraform infrastructure
run: terraform apply --auto-approve
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ _[See how to do it with `systemctl`](https://documentation.suse.com/smart/system
* The user's host must be able to `ssh` to each of the nodes passwordlessly.
* There should be at least one available and running network interface capable of sending and receiving packets between the user's host and management nodes via IPv4.
* Ability to read/write to the `/opt` directory on the nodes.
* On the MySQL nodes port `3306` should be open for communication within the nodes.
* On the Management nodes port `6446` should be open for communication within the nodes.
* For production setups follow [SECURITY.md](docs/SECURITY.md).
* On the MySQL nodes port `3306` should be open for external communication.
* On the Management nodes port `6446` should be open for external communication.

### Installed software

Expand Down
File renamed without changes.
31 changes: 0 additions & 31 deletions linters.yml

This file was deleted.

Empty file added security.yml
Empty file.
3 changes: 1 addition & 2 deletions tests/TESTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,9 @@ Ansible playbook running testsuite against applied terraform infrastructure, tha

### Required software

Testing host is the `ubuntu:22.04` and has the following software installed:
Testing host is the `ubuntu:22.04` runner with the [software installed](../README.md#installed-software) meeting the [required criteria](../README.md/#hosts-specification) with the following software installed for testing:

Check failure on line 32 in tests/TESTING.md

View workflow job for this annotation

GitHub Actions / lint

Line length [Expected: 80; Actual: 222]

* `terraform v1.0.10`
* `openssh-server v1:8.9p1-3ubuntu0.7`
* `python v3.10.12` with the following third party packages:
* `ansible v9.5.1`

Expand Down

0 comments on commit 4c604e7

Please sign in to comment.