Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions .github/workflows/doxygen.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Doxygen Docs

on:
push:
tags:
- "v*"

jobs:
docs:
name: Generate Doxygen documentation
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install Doxygen
run: |
sudo apt-get update
sudo apt-get install -y doxygen

- name: Generate documentation
working-directory: laboratories/cicd-documentation
run: doxygen Doxyfile

- name: Upload documentation artifact
uses: actions/upload-artifact@v4
with:
name: doxygen-html
path: laboratories/cicd-documentation/html

27 changes: 16 additions & 11 deletions .github/workflows/run.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,25 @@
name: cicd-documentation
name: Unit Tests

on:
workflow_dispatch:
pull_request:
branches:
- main
types:
- opened

jobs:
run:
name: 🚀 Run
test:
name: Run unit tests
runs-on: ubuntu-latest
steps:
- name: 📥 Checkout
- name: Checkout
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
fetch-depth: 0
python-version: "3.x"

- name: 🚀 Run
shell: bash
run: |
cd laboratories/cicd-documentation
python3 main.py
- name: Run unit tests
working-directory: laboratories/cicd-documentation
run: python -m unittest -v
67 changes: 67 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
cover/

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Type checkers
.mypy_cache/
.dmypy.json
dmypy.json
.pyre/
.pytype/

# Editors
.idea/
.vscode/

# Generated documentation
laboratories/cicd-documentation/html/
laboratories/cicd-documentation/latex/

160 changes: 0 additions & 160 deletions laboratories/cicd-documentation/.gitignore

This file was deleted.

22 changes: 22 additions & 0 deletions laboratories/cicd-documentation/Doxyfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
PROJECT_NAME = "Tree traversal"
PROJECT_BRIEF = "Binary tree traversals and search operations."
OUTPUT_DIRECTORY =
CREATE_SUBDIRS = NO
OUTPUT_LANGUAGE = English
USE_MDFILE_AS_MAINPAGE = README.md
BRIEF_MEMBER_DESC = YES
REPEAT_BRIEF = YES
ALWAYS_DETAILED_SEC = NO
FULL_PATH_NAMES = NO
EXTRACT_ALL = YES
EXTRACT_PRIVATE = YES
EXTRACT_STATIC = YES
RECURSIVE = NO
INPUT = README.md main.py node.py tree.py
FILE_PATTERNS = *.py *.md
EXTENSION_MAPPING = py=Python
GENERATE_HTML = YES
HTML_OUTPUT = html
GENERATE_LATEX = NO
QUIET = YES
WARN_IF_UNDOCUMENTED = YES
1 change: 0 additions & 1 deletion laboratories/cicd-documentation/main.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from tree import Tree
from node import Node

tree = Tree()

Expand Down
10 changes: 6 additions & 4 deletions laboratories/cicd-documentation/node.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
from typing import Optional


class Node:
""" Node class for binary tree """

def __init__(self, data):
self.left = None
self.right = None
def __init__(self, data: int) -> None:
self.left: Optional["Node"] = None
self.right: Optional["Node"] = None
self.data = data

Loading