The runner container cannot resolve 'forgejo' Docker hostname. Set GITHUB_SERVER_URL to the accessible URL (10.100.0.2:3000). - Add FORGEJO_URL env var (defaults to http://10.100.0.2:3000) - Override GITHUB_SERVER_URL for checkout action - Can be configured via vars.FORGEJO_URL in Forgejo settings
72 lines
1.8 KiB
YAML
72 lines
1.8 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
pull_request:
|
|
branches: [main]
|
|
|
|
env:
|
|
PIP_CACHE_DIR: ${{ github.workspace }}/.cache/pip
|
|
PYTHONUNBUFFERED: "1"
|
|
|
|
jobs:
|
|
lint:
|
|
runs-on: docker
|
|
container:
|
|
image: catthehacker/ubuntu:act-latest
|
|
env:
|
|
GITHUB_SERVER_URL: ${{ vars.FORGEJO_URL || 'http://10.100.0.2:3000' }}
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Set up Python
|
|
uses: actions/setup-python@v5
|
|
with:
|
|
python-version: '3.12'
|
|
- name: Install dependencies
|
|
run: |
|
|
python -m pip install --upgrade pip
|
|
pip install ruff black
|
|
- name: Run ruff
|
|
run: ruff check app tests scripts
|
|
- name: Run black
|
|
run: black --check app tests scripts
|
|
|
|
test:
|
|
runs-on: docker
|
|
container:
|
|
image: catthehacker/ubuntu:act-latest
|
|
env:
|
|
GITHUB_SERVER_URL: ${{ vars.FORGEJO_URL || 'http://10.100.0.2:3000' }}
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Set up Python
|
|
uses: actions/setup-python@v5
|
|
with:
|
|
python-version: '3.12'
|
|
- name: Install dependencies
|
|
run: |
|
|
python -m pip install --upgrade pip
|
|
pip install -r requirements-dev.txt
|
|
- name: Run tests
|
|
run: pytest -q tests -v
|
|
|
|
type-check:
|
|
runs-on: docker
|
|
container:
|
|
image: catthehacker/ubuntu:act-latest
|
|
env:
|
|
GITHUB_SERVER_URL: ${{ vars.FORGEJO_URL || 'http://10.100.0.2:3000' }}
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Set up Python
|
|
uses: actions/setup-python@v5
|
|
with:
|
|
python-version: '3.12'
|
|
- name: Install dependencies
|
|
run: |
|
|
python -m pip install --upgrade pip
|
|
pip install mypy
|
|
pip install -r requirements.txt
|
|
- name: Run mypy
|
|
run: mypy app scripts --ignore-missing-imports |