Add Pelican Panel API key support #1

Merged
k.eaven merged 5 commits from development into main 2026-10-24 08:01:49 +00:00
Showing only changes of commit d891b21ffd - Show all commits
+45 -45
View File
@@ -23,7 +23,7 @@ jobs:
# ========================================== # ==========================================
# TESTING STAGE # TESTING STAGE
# ========================================== # ==========================================
unit-tests: unit-tests:
name: Unit Tests (Python ${{ matrix.python-version }}) name: Unit Tests (Python ${{ matrix.python-version }})
runs-on: ubuntu-latest runs-on: ubuntu-latest
@@ -32,7 +32,7 @@ jobs:
fail-fast: false fail-fast: false
matrix: matrix:
python-version: ['3.11', '3.12', '3.13'] python-version: ['3.11', '3.12', '3.13']
steps: steps:
- name: Checkout code - name: Checkout code
uses: actions/checkout@v3 uses: actions/checkout@v3
@@ -46,24 +46,21 @@ jobs:
git config --global http.lowSpeedLimit 0 git config --global http.lowSpeedLimit 0
git config --global http.lowSpeedTime 999999 git config --global http.lowSpeedTime 999999
- name: Set up Python ${{ matrix.python-version }} - name: Set up uv & Python ${{ matrix.python-version }}
uses: actions/setup-python@v4 uses: astral-sh/setup-uv@v5
with: with:
python-version: ${{ matrix.python-version }} python-version: ${{ matrix.python-version }}
activate-environment: true
- name: Cache pip dependencies enable-cache: true
uses: actions/cache@v3 cache-dependency-glob: |
with: requirements.txt
path: ~/.cache/pip requirements-test.txt
key: ${{ runner.os }}-py${{ matrix.python-version }}-pip-${{ hashFiles('requirements.txt', 'requirements-test.txt') }}
restore-keys: |
${{ runner.os }}-py${{ matrix.python-version }}-pip-
- name: Install dependencies - name: Install dependencies
run: | run: |
python -m pip install --upgrade pip setuptools wheel uv pip install --upgrade setuptools wheel
pip install -r requirements.txt uv pip install -r requirements.txt
pip install -r requirements-test.txt uv pip install -r requirements-test.txt
- name: Create test configuration - name: Create test configuration
run: | run: |
@@ -81,7 +78,7 @@ jobs:
- name: Run unit tests with coverage - name: Run unit tests with coverage
run: | run: |
pytest test_pterodisbot.py \ python -m pytest test_pterodisbot.py \
-v \ -v \
--tb=short \ --tb=short \
--cov=pterodisbot \ --cov=pterodisbot \
@@ -104,7 +101,7 @@ jobs:
name: Code Quality & Linting name: Code Quality & Linting
runs-on: ubuntu-latest runs-on: ubuntu-latest
if: ${{ !inputs.skip_tests }} if: ${{ !inputs.skip_tests }}
steps: steps:
- name: Checkout code - name: Checkout code
uses: actions/checkout@v3 uses: actions/checkout@v3
@@ -118,15 +115,17 @@ jobs:
git config --global http.lowSpeedLimit 0 git config --global http.lowSpeedLimit 0
git config --global http.lowSpeedTime 999999 git config --global http.lowSpeedTime 999999
- name: Set up Python - name: Set up uv & Python
uses: actions/setup-python@v4 uses: astral-sh/setup-uv@v5
with: with:
python-version: '3.12' python-version: '3.12'
activate-environment: true
enable-cache: true
- name: Install linting tools - name: Install linting tools
run: | run: |
python -m pip install --upgrade pip uv pip install --upgrade setuptools wheel
pip install flake8 pylint black isort mypy uv pip install flake8 pylint black isort mypy
- name: Run flake8 - name: Run flake8
run: | run: |
@@ -176,7 +175,7 @@ jobs:
name: Security Scanning name: Security Scanning
runs-on: ubuntu-latest runs-on: ubuntu-latest
if: ${{ !inputs.skip_tests }} if: ${{ !inputs.skip_tests }}
steps: steps:
- name: Checkout code - name: Checkout code
uses: actions/checkout@v3 uses: actions/checkout@v3
@@ -190,15 +189,17 @@ jobs:
git config --global http.lowSpeedLimit 0 git config --global http.lowSpeedLimit 0
git config --global http.lowSpeedTime 999999 git config --global http.lowSpeedTime 999999
- name: Set up Python - name: Set up uv & Python
uses: actions/setup-python@v4 uses: astral-sh/setup-uv@v5
with: with:
python-version: '3.12' python-version: '3.12'
activate-environment: true
enable-cache: true
- name: Install security tools - name: Install security tools
run: | run: |
python -m pip install --upgrade pip uv pip install --upgrade setuptools wheel
pip install bandit safety pip-audit uv pip install bandit safety pip-audit
- name: Run bandit security scan - name: Run bandit security scan
run: | run: |
@@ -211,7 +212,7 @@ jobs:
- name: Run safety dependency check - name: Run safety dependency check
run: | run: |
pip install -r requirements.txt uv pip install -r requirements.txt
safety check --json --output safety-report.json || true safety check --json --output safety-report.json || true
continue-on-error: true continue-on-error: true
@@ -234,7 +235,7 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: [unit-tests] needs: [unit-tests]
if: ${{ !inputs.skip_tests }} if: ${{ !inputs.skip_tests }}
steps: steps:
- name: Checkout code - name: Checkout code
uses: actions/checkout@v3 uses: actions/checkout@v3
@@ -248,22 +249,21 @@ jobs:
git config --global http.lowSpeedLimit 0 git config --global http.lowSpeedLimit 0
git config --global http.lowSpeedTime 999999 git config --global http.lowSpeedTime 999999
- name: Set up Python - name: Set up uv & Python
uses: actions/setup-python@v4 uses: astral-sh/setup-uv@v5
with: with:
python-version: '3.12' python-version: '3.12'
activate-environment: true
- name: Cache dependencies enable-cache: true
uses: actions/cache@v3 cache-dependency-glob: |
with: requirements.txt
path: ~/.cache/pip requirements-test.txt
key: ${{ runner.os }}-pip-integration-${{ hashFiles('requirements.txt') }}
- name: Install dependencies - name: Install dependencies
run: | run: |
python -m pip install --upgrade pip uv pip install --upgrade setuptools wheel
pip install -r requirements.txt uv pip install -r requirements.txt
pip install -r requirements-test.txt uv pip install -r requirements-test.txt
- name: Create test configuration - name: Create test configuration
run: | run: |
@@ -281,7 +281,7 @@ jobs:
- name: Run integration tests - name: Run integration tests
run: | run: |
pytest test_pterodisbot.py::TestIntegration \ python -m pytest test_pterodisbot.py::TestIntegration \
-v \ -v \
--tb=short \ --tb=short \
--timeout=60 --timeout=60
@@ -289,7 +289,7 @@ jobs:
# ========================================== # ==========================================
# BUILD STAGE # BUILD STAGE
# ========================================== # ==========================================
docker-build: docker-build:
name: Build Docker Image name: Build Docker Image
runs-on: ubuntu-latest runs-on: ubuntu-latest
@@ -298,7 +298,7 @@ jobs:
always() && always() &&
(needs.unit-tests.result == 'success' || inputs.skip_tests) && (needs.unit-tests.result == 'success' || inputs.skip_tests) &&
(github.event_name == 'push' || github.event_name == 'workflow_dispatch') (github.event_name == 'push' || github.event_name == 'workflow_dispatch')
steps: steps:
- name: Checkout code - name: Checkout code
uses: actions/checkout@v3 uses: actions/checkout@v3
@@ -384,13 +384,13 @@ jobs:
# ========================================== # ==========================================
# REPORTING STAGE # REPORTING STAGE
# ========================================== # ==========================================
test-report: test-report:
name: Generate Test Report name: Generate Test Report
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: [unit-tests, code-quality, security-scan, integration-tests] needs: [unit-tests, code-quality, security-scan, integration-tests]
if: always() && !inputs.skip_tests if: always() && !inputs.skip_tests
steps: steps:
- name: Download all artifacts - name: Download all artifacts
uses: actions/download-artifact@v3 uses: actions/download-artifact@v3
@@ -419,7 +419,7 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: [test-report, docker-build] needs: [test-report, docker-build]
if: always() if: always()
steps: steps:
- name: Check pipeline status - name: Check pipeline status
run: | run: |