Skip to content

feat: Initial professional release of Qoder Reset Tool #1

feat: Initial professional release of Qoder Reset Tool

feat: Initial professional release of Qoder Reset Tool #1

Workflow file for this run

name: CI/CD Pipeline
on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main ]
release:
types: [ published ]
jobs:
test:
name: Test on ${{ matrix.os }} with Python ${{ matrix.python-version }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11']
exclude:
# Exclude some combinations to reduce CI time
- os: macos-latest
python-version: '3.7'
- os: macos-latest
python-version: '3.8'
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Cache pip dependencies
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install system dependencies (Linux)
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y xvfb libxkbcommon-x11-0 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxcb-xinerama0 libxcb-xfixes0
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install pytest pytest-qt pytest-cov flake8 black
- name: Lint with flake8
run: |
# Stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# Exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Check code formatting with Black
run: |
black --check --diff .
- name: Test with pytest (Linux with Xvfb)
if: runner.os == 'Linux'
run: |
xvfb-run -a pytest --cov=qoder_reset_gui --cov-report=xml --cov-report=term-missing
env:
QT_QPA_PLATFORM: offscreen
- name: Test with pytest (Windows/macOS)
if: runner.os != 'Linux'
run: |
pytest --cov=qoder_reset_gui --cov-report=xml --cov-report=term-missing
env:
QT_QPA_PLATFORM: offscreen
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
file: ./coverage.xml
flags: unittests
name: codecov-umbrella
fail_ci_if_error: false
security-scan:
name: Security Scan
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.9'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install bandit safety
- name: Run Bandit security scan
run: |
bandit -r . -f json -o bandit-report.json || true
- name: Run Safety check
run: |
safety check --json --output safety-report.json || true
- name: Upload security reports
uses: actions/upload-artifact@v3
with:
name: security-reports
path: |
bandit-report.json
safety-report.json
build:
name: Build Application
needs: [test, security-scan]
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.9'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install pyinstaller
- name: Build executable (Windows)
if: runner.os == 'Windows'
run: |
pyinstaller --onefile --windowed --name "QoderResetTool" qoder_reset_gui.py
- name: Build executable (macOS)
if: runner.os == 'macOS'
run: |
pyinstaller --onefile --windowed --name "QoderResetTool" qoder_reset_gui.py
- name: Build executable (Linux)
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y xvfb libxkbcommon-x11-0 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxcb-xinerama0 libxcb-xfixes0
pyinstaller --onefile --windowed --name "QoderResetTool" qoder_reset_gui.py
- name: Upload build artifacts
uses: actions/upload-artifact@v3
with:
name: qoder-reset-tool-${{ runner.os }}
path: |
dist/
retention-days: 30
release:
name: Create Release
needs: [build]
runs-on: ubuntu-latest
if: github.event_name == 'release'
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Download all artifacts
uses: actions/download-artifact@v3
- name: Create release archives
run: |
# Create archives for each platform
cd qoder-reset-tool-Linux && tar -czf ../qoder-reset-tool-linux.tar.gz * && cd ..
cd qoder-reset-tool-Windows && zip -r ../qoder-reset-tool-windows.zip * && cd ..
cd qoder-reset-tool-macOS && tar -czf ../qoder-reset-tool-macos.tar.gz * && cd ..
- name: Upload release assets
uses: softprops/action-gh-release@v1
with:
files: |
qoder-reset-tool-linux.tar.gz
qoder-reset-tool-windows.zip
qoder-reset-tool-macos.tar.gz
draft: false
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
code-quality:
name: Code Quality Analysis
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0 # Shallow clones should be disabled for better analysis
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.9'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install pylint mypy
- name: Run Pylint
run: |
pylint qoder_reset_gui.py --output-format=json > pylint-report.json || true
- name: Run MyPy type checking
run: |
mypy qoder_reset_gui.py --ignore-missing-imports --json-report mypy-report || true
- name: Upload code quality reports
uses: actions/upload-artifact@v3
with:
name: code-quality-reports
path: |
pylint-report.json
mypy-report/
documentation:
name: Build Documentation
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.9'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install sphinx sphinx-rtd-theme
- name: Generate documentation
run: |
# Create basic Sphinx documentation structure if it doesn't exist
if [ ! -d "docs" ]; then
sphinx-quickstart -q -p "Qoder Reset Tool" -a "Contributors" -v "1.0.0" --ext-autodoc --ext-viewcode --makefile --no-batchfile docs
fi
# Build documentation
cd docs && make html
- name: Upload documentation
uses: actions/upload-artifact@v3
with:
name: documentation
path: docs/_build/html/
notify:
name: Notify on Success
needs: [test, security-scan, build, code-quality]
runs-on: ubuntu-latest
if: success()
steps:
- name: Notify success
run: |
echo "✅ All CI/CD pipeline jobs completed successfully!"
echo "📊 Test results: Passed"
echo "🔒 Security scan: Completed"
echo "🏗️ Build: Successful"
echo "📈 Code quality: Analyzed"