## Problem
Run #67 of `merge_main.yaml` failed with:
```
fatal: unable to access 'https:///admin/brencher.git/': URL rejected: No host part in the URL
```
The `PUSH_TOKEN` secret is now wired up correctly, but `${GITEA_SERVER_URL}` is empty in this Gitea Actions runtime (the variable the env-prefixed runner is supposed to set), so the substituted URL drops the host.
## Fix
Hardcode `gitea.rudolf.keenetic.link` in both `merge_main.yaml` and `merge_main_and_squash.yaml`. When the runner exposes `GITEA_SERVER_URL` in a future version, this can be replaced back with `${GITEA_SERVER_URL#https://}`.
## Supersedes
This is a follow-up to admin/brencher#46 which already wired `secrets.PUSH_TOKEN` but still had the empty env var.Reviewed-on: http://192.168.1.96/admin/brencher/pulls/47
Co-authored-by: hermes <rudolfss13+hermes@gmail.com>
Both workflows were written for github.com and relied on the implicit
secrets.GITHUB_TOKEN + github.repository + a hardcoded github.com URL.
On this self-hosted Gitea instance (ghauth.rudolf.keenetic.link) they fail
with "Invalid username or token. Password authentication is not supported
for Git operations." against https://github.com/admin/brencher.git.
The fix:
- Read the push token from a new repo-level secret GITEA_PUSH_TOKEN
(admin/brencher). Same value is injected into the checkout and into the
rewritten remote URL so push can succeed.
- Build the origin URL from Gitea-injected GITHUB_REPOSITORY and
GITEA_SERVER_URL instead of hardcoding github.com.
- Update git user.email/name for the Gitea Actions identity.
To enable: create secret GITEA_PUSH_TOKEN in admin/brencher (a PAT with
write access to the repo) via the Gitea UI before merging this PR.
## Summary
Optimizes `.github/workflows/python-package.yml` so the build job runs in ~3-4 minutes instead of ~13 minutes (which is what the recent run on PR #5 took — see https://gitea.rudolf.keenetic.link/admin/brencher/actions/runs/14, started 23:52, completed 00:05, **13m 19s wall-clock**).
## Why it was slow
The current matrix has **3 Python versions × 5 checkers = 15 separate CI jobs**, each one:
1. Checking out the repo (~10s)
2. Setting up Python via `actions/setup-python@v3` with **no cache enabled** (~15-30s)
3. Running `pip install -r requirements.txt -r requirements-dev.txt` **from scratch every single time** (~30-90s per job × 15 jobs = 7-22 minutes wasted)
The two debug entries (`python -c 'import sys; print(...)'` and `pip list`) were not real checks — they were noise from the upstream github `build-and-test-python` template, left in place but never reviewed.
## What's in this PR
- `.github/workflows/python-package.yml` — single file, +41/-56
1. **`cache: 'pip'` enabled** with `cache-dependency-path: requirements.txt, requirements-dev.txt` — first run downloads and caches, subsequent runs hit the cache. Drops pip install from ~60s to ~5-15s when requirements don't change.
2. **Two debug-only matrix entries removed** (`python -c ...` and `pip list`) — they were not real checks.
3. **Matrix restructured**: one Python-version axis only, no checker axis. Each Python job runs `install + flake8 + mypy` sequentially. **15 jobs → 3 jobs** (~5x fewer fresh venvs to set up).
4. **`concurrency: cancel-in-progress: true`** added — a new push to the same PR auto-cancels the previous in-flight run, saving runner minutes when iterating on a fix.
5. Bumped `actions/setup-python` from `v3` to `v5` (required for `cache: 'pip'`).
## Verification
- YAML parses via PyYAML — ok
- `jobs` dict contains `['build']` only
- `build.strategy.matrix.python-version` = `['3.12.3', '3.13', '3.14']`
- **total CI jobs: 3** (was 15)
- `setup-python@v5` with `cache: 'pip'` + `cache-dependency-path` pointing at `requirements.txt` and `requirements-dev.txt`
- `concurrency` block correctly scoped to `ci-${{ github.workflow }}-${{ github.ref }}`
## Expected timing
| Scenario | Before | After |
|---|---|---|
| First run (cold cache) | ~13m 19s | ~5-7m |
| Subsequent runs (warm cache, no req changes) | ~13m 19s | ~3-4m |
| Re-run after `requirements.txt` change | ~13m 19s | ~4-5m |
## What was NOT verified
- Actual Gitea Actions runner behaviour with `cache: 'pip'` — the Gitea Actions runner is GitHub Actions-compatible, and `actions/setup-python@v5` with `cache: 'pip'` is a well-known idiom there, but the local Gitea runner config may or may not honour it. If it doesn't, the 15→3 fan-out reduction alone is still a ~5x speedup.
## Note on PR #14
PR #14 ("re-enable the tests job") is still open. If/when it merges, this PR will need a follow-up to re-add the `tests:` job with the same `cache: 'pip'` setup applied — otherwise the playwright install will dominate again.
## Commit history
```
* db3807e (HEAD -> feat/optimize-ci-build-time, origin/feat/optimize-ci-build-time)
ci: speed up python-package.yml from ~13min to ~3-4min
* 70f4a41 ci: comment out the tests job in python-package.yml (#13) (upstream/main tip)
```
---------
Co-authored-by: admin <rudolfss13@gmail.com>
Co-authored-by: hermes <hermes@rudolf.keenetic.link>
Reviewed-on: http://192.168.1.96/admin/brencher/pulls/15
Co-authored-by: hermes <rudolfss13+hermes@gmail.com>
## Summary
Comments out the `tests:` job in `.github/workflows/python-package.yml`. The slow `pytest` matrix (with `playwright install --with-deps chromium`) no longer runs on every push or PR — only the cheap `build` job (lint + mypy) remains.
## Why
- `pytest` requires `playwright install --with-deps chromium` on every run, which dominates the CI time even though pytest is not currently the merge gate.
- The `build` job (flake8 + mypy) still runs and still catches real regressions cheaply.
- `workflow_dispatch` is unchanged — tests can still be triggered manually from the Actions UI when needed.
## What's in this PR
- `.github/workflows/python-package.yml` — single file, +35/-34
- The `tests:` job (33 lines) is now commented with leading `# `
- Everything else (triggers, `build:` job, matrix) is unchanged
- YAML still parses cleanly; `jobs` dict now contains only `build`
## Verification
- `python -c "import yaml; yaml.safe_load(open('.github/workflows/python-package.yml'))"` — OK
- `wf['jobs']` contains `['build']` only (no `tests` key)
- `build.matrix.checker` still has all 5 checkers:
- `python -c "import sys; ..."` (debug)
- `pip list` (debug)
- `flake8 . --select=E9,F63,F7,F82` (syntax errors)
- `flake8 . --exit-zero --max-complexity=10` (complexity)
- `mypy --no-incremental --config-file mypy.ini backend tests`
- triggers unchanged: `workflow_dispatch`, `push`, `pull_request` (all targeting `main`)
## How to re-enable
Remove the leading `# ` from each commented line, or delete the commented block entirely and rely on git history.
## What was NOT verified
- The actual GitHub Actions runner behaviour change — this repo runs on Gitea Actions (the project's primary CI is the brencher pipeline itself, not Gitea-hosted runners for these workflows). Gitea's Actions runner is GitHub Actions–compatible and will see the `tests` job as absent and skip it.
## Commit history
```
* e271b2e (HEAD -> feat/disable-ci-tests, origin/feat/disable-ci-tests)
ci: comment out the tests job in python-package.yml
* e533174 Allow naming each GitClone remote explicitly (#3) (upstream/main tip)
```
---------
Co-authored-by: hermes <hermes@rudolf.keenetic.link>
Reviewed-on: http://192.168.1.96/admin/brencher/pulls/13
Co-authored-by: hermes <rudolfss13+hermes@gmail.com>