Skip to content

Commit

Permalink
new structure + badges
Browse files Browse the repository at this point in the history
  • Loading branch information
szachovy committed Jun 27, 2024
1 parent 0b534ce commit 5dcabb1
Show file tree
Hide file tree
Showing 6 changed files with 167 additions and 199 deletions.
1 change: 1 addition & 0 deletions .github/coverage.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
print("86%")
159 changes: 0 additions & 159 deletions .github/workflows/qa.yml

This file was deleted.

51 changes: 51 additions & 0 deletions .github/workflows/stateful-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Stateful Tests

on:
push:
branches: '**'

jobs:
setup:
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 ansible==9.5.1

- name: Setup Terraform
uses: hashicorp/setup-terraform@v3
with:
terraform_version: "1.0.10"

- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: "16"

tests:
runs-on: self-hosted
needs: setup
steps:
- name: Initialize Terraform infrastructure
run: terraform init
working-directory: ./tests/setup

- name: Apply Terraform infrastructure
run: terraform apply --auto-approve
working-directory: ./tests/setup

- name: Run Ansible testsuite
run: ansible-playbook --inventory inventory.yml deploy.yml
working-directory: ./tests/testsuite

- name: Destroy Terraform environment
if: always()
run: terraform destroy --auto-approve
working-directory: ./tests/setup
112 changes: 112 additions & 0 deletions .github/workflows/static-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
name: Static Tests

on:
push:
branches: '**'

jobs:
setup:
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 }}

lint-markdown:
runs-on: self-hosted
needs: setup
steps:
- name: Lint Markdown files
uses: articulate/actions-markdownlint@v1
with:
files: "$(find . -name '*.md')"
version: "0.41.0"

lint-shell:
runs-on: self-hosted
needs: setup
steps:
- name: Lint shell scripts
uses: ludeeus/action-shellcheck@master
with:
version: "v0.10.0"

lint-docker:
runs-on: self-hosted
needs: setup
steps:
- name: Lint Dockerfiles
uses: hadolint/[email protected]
with:
dockerfile: Dockerfile
recursive: true

lint-terraform:
runs-on: self-hosted
needs: setup
steps:
- name: Lint Terraform testing infrastructure
run: tflint
working-directory: ./tests/setup

lint-ansible:
runs-on: self-hosted
needs: setup
steps:
- name: Lint ansible testing playbook
uses: ansible/ansible-lint@main

lint-python-pylint:
runs-on: self-hosted
needs: setup
steps:
- name: Lint Python files with pylint
run: "pylint $(find . -name '*.py')"

lint-python-mypy:
runs-on: self-hosted
needs: setup
steps:
- name: Lint Python files with mypy
run: "mypy $(find . -name '*.py')"

lint-python-flake8:
runs-on: self-hosted
needs: setup
steps:
- name: Lint Python files with flake8
run: "flake8"

Check failure on line 97 in .github/workflows/static-tests.yml

View workflow job for this annotation

GitHub Actions / lint-ansible

yaml[trailing-spaces]

Trailing spaces
system-tests-coverage:
runs-on: self-hosted
needs: setup
steps:
- name: System tests coverage
uses: schneegans/[email protected]
with:
auth: ${{ secrets.GIST_SECRET }}
gistID: d4fd269e226b0ed70954f861129a2756
filename: superset-cluster-codecoverage.json
label: System tests coverage
message: $(python3 .github/coverage.py)
valColorRange: $(python3 .github/coverage.py)
maxColorRange: 100
minColorRange: 0
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
![badge](https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/szachovy/d4fd269e226b0ed70954f861129a2756/raw/superset-cluster-codecoverage.json)
![Stateful Tests](https://github.com/szachovy/superset-cluster/actions/workflows/stateful-tests.yml/badge.svg)
![Static Tests](https://github.com/szachovy/superset-cluster/actions/workflows/static-tests.yml/badge.svg)
![System Tests Coverage](https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/szachovy/d4fd269e226b0ed70954f861129a2756/raw/superset-cluster-codecoverage.json)

# superset-cluster

Expand Down
39 changes: 0 additions & 39 deletions coverage.py

This file was deleted.

0 comments on commit 5dcabb1

Please sign in to comment.