Skip to content

Commit

Permalink
Merge branch 'main' into feat/add-pytest-tests
Browse files Browse the repository at this point in the history
  • Loading branch information
andreasbaumgartner authored Apr 24, 2024
2 parents a38fae7 + 12c99dc commit 1bb51e3
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 2 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/python-app.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Test

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

permissions:
contents: read

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Set up Python 3.11
uses: actions/setup-python@v3
with:
python-version: "3.10"
cache: 'pip' # caching pip dependencies

- name: cache virtualenv
uses: actions/cache@v3
id: cache-venv
with:
path: ./.venv/
key: ${{ runner.os }}-${{ steps.setup_python.outputs.python-version }}-venv-${{ hashFiles('requirements.txt') }}
restore-keys: |
${{ runner.os }}-${{ steps.setup_python.outputs.python-version }}-venv-
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install ruff pytest
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
if: steps.cache-venv.outputs.cache-hit != 'true'

- name: Lint with ruff
run: |
ruff check --output-format=github .
- name: Test with pytest
run: |
pytest
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<p align="center">
<img src="![Project Logo](https://github.com/andreasbaumgartner/pompeji/project_img.png)" width="100" alt="project-logo">
<img src="project_img.png" width="100" height="120">
</p>
<p align="center">
<h1 align="center">POMPEJI</h1>
Expand Down
5 changes: 4 additions & 1 deletion src/check_sys.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,23 +18,26 @@ def check_os_system(self):
print("Only Linux is supported")
sys.exit(1)


def check_python_installed(self):
"""check if python is installed"""
if os.system("python3 --version") != 0:
print("Python is not installed")
sys.exit(1)


def check_python_version(self):
"""check python version"""
if os.system("python3 --version") >= 3.10:
print("Please use Python 3.10 or higher")
sys.exit(1)


def check_git_installed(self):
"""check if git is installed"""
if os.system("git --version") != 0:
print("Git is not installed")
sys.exit(1)

def __str__(self):
return "SystemCheck Class"
return "SystemCheck Class"

0 comments on commit 1bb51e3

Please sign in to comment.