Skip to content

215 poprawa typów dla myp i uzupełnienie tłumaczeń EN #498

215 poprawa typów dla myp i uzupełnienie tłumaczeń EN

215 poprawa typów dla myp i uzupełnienie tłumaczeń EN #498

Workflow file for this run

name: CI Pipeline (Testy Jednostkowe + E2E)
on:
pull_request:
branches: [ main ]
# Nie anuluj trwającego biegu, gdy wpadnie kolejny push do tej samej gałęzi/PR
# (dzięki temu testy dociągną do końca i damy zielonego checka).
concurrency:
group: ci-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: false
jobs:
unit-tests:
runs-on: ubuntu-latest
timeout-minutes: 5
permissions:
contents: read
strategy:
fail-fast: true
matrix:
python-version: ['3.11']
env:
# Stabilność: nie ładuj losowych pluginów z runnera
PYTEST_DISABLE_PLUGIN_AUTOLOAD: "1"
# Tryb dla pytest-asyncio (zamiast flagi CLI)
PYTEST_ASYNCIO_MODE: "auto"
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: pip
cache-dependency-path: requirements-ci.txt
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements-ci.txt
- name: Run unit tests
run: |
# Jawne pluginy (autoload wyłączony):
# - pytest_asyncio.plugin: obsługa async i markera @pytest.mark.asyncio
# - pytest_timeout: per-test timeouty
pytest pc_client/tests/ tests/ \
--ignore=tests/e2e \
-q --maxfail=1 --tb=short \
-p pytest_asyncio.plugin \
-p pytest_timeout \
--timeout=30 --timeout-method=thread
- name: Show test summary on failure
if: failure()
run: |
echo "Unit tests failed! Check the output above for details."
exit 1
- name: Unit tests passed
if: success()
run: |
echo "Unit tests successfully executed and confirmed."
e2e-tests:
runs-on: ubuntu-latest
timeout-minutes: 10
permissions:
contents: read
strategy:
fail-fast: true
matrix:
python-version: ['3.11']
env:
# Stabilność: nie ładuj losowych pluginów z runnera
PYTEST_DISABLE_PLUGIN_AUTOLOAD: "1"
# Tryb dla pytest-asyncio (zamiast flagi CLI)
PYTEST_ASYNCIO_MODE: "auto"
# Playwright ma instalować przeglądarki w katalogu roboczym (cache działa w obrębie joba)
PLAYWRIGHT_BROWSERS_PATH: "0"
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: pip
cache-dependency-path: requirements-ci.txt
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements-ci.txt
- name: Install Playwright browsers
run: |
python -m playwright install chromium --with-deps
- name: Run E2E tests
run: |
# E2E testy dla interfejsu webowego
# Używają Playwright do testowania UI w przeglądarce
pytest tests/e2e/ \
-v --tb=short
- name: Show test summary on failure
if: failure()
run: |
echo "E2E tests failed! Check the output above for details."
exit 1
- name: E2E tests passed
if: success()
run: |
echo "E2E tests successfully executed and confirmed."
css-ui-audit:
runs-on: ubuntu-latest
timeout-minutes: 15
permissions:
contents: read
env:
TEST_MODE: "true"
PLAYWRIGHT_BROWSERS_PATH: "0"
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
- name: Set up Python 3.11
uses: actions/setup-python@v5
with:
python-version: "3.11"
cache: pip
cache-dependency-path: requirements-ci.txt
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements-ci.txt
- name: Install Playwright browsers
run: |
python -m playwright install firefox --with-deps
- name: Install npm dependencies
run: npm ci
- name: CSS lint
run: npm run lint:css
- name: CSS size check
run: npm run css:size
- name: CSS audit (screenshots + coverage)
run: npm run css:audit
- name: Upload CSS audit artifacts
if: always()
uses: actions/upload-artifact@v4
with:
name: css-audit-artifacts
path: |
logs/css_audit_summary.json
logs/css_audit