ci(forgejo): use python containers and pip
Some checks failed
CI / lint (pull_request) Failing after 32s
CI / typecheck (pull_request) Failing after 1m37s
CI / test (pull_request) Failing after 2m24s
CI / security (pull_request) Failing after 37s
CI / gitleaks (pull_request) Successful in 35s
CI / commitlint (pull_request) Failing after 13s

This commit is contained in:
Crypto Rug Munch 2026-07-03 18:09:07 +02:00
parent 550cf11deb
commit 68722b2c22

View file

@ -2,8 +2,6 @@
# Copyright (c) 2026 Rug Munch Media LLC
# Part of Pry — https://git.rugmunch.io/RugMunchMedia/pryscraper
# Licensed under MIT. See LICENSE.
#
# Force workflow re-parse: bump cache key 2026-07-03-a
name: CI
on:
@ -22,70 +20,120 @@ env:
jobs:
lint:
runs-on: docker-x64
container:
image: python:3.12-slim
steps:
- name: Install Node.js for actions/checkout
run: |
apt-get update
apt-get install -y --no-install-recommends curl ca-certificates git
curl -fsSL https://deb.nodesource.com/setup_22.x | bash -
apt-get install -y --no-install-recommends nodejs
rm -rf /var/lib/apt/lists/*
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
cache: pip
cache-dependency-path: pyproject.toml
- run: pip install ruff
- run: ruff check .
- run: ruff format --check .
- name: Install ruff
run: pip install ruff
- name: Lint
run: ruff check .
- name: Format check
run: ruff format --check .
typecheck:
runs-on: docker-x64
container:
image: python:3.12-slim
steps:
- name: Install Node.js for actions/checkout
run: |
apt-get update
apt-get install -y --no-install-recommends curl ca-certificates git
curl -fsSL https://deb.nodesource.com/setup_22.x | bash -
apt-get install -y --no-install-recommends nodejs
rm -rf /var/lib/apt/lists/*
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
cache: pip
cache-dependency-path: pyproject.toml
- run: pip install -e ".[dev]"
- run: mypy --python-version 3.12 --strict --ignore-missing-imports --exclude 'build/|dist/|.git/|__pycache__/' *.py
- name: Install dependencies
run: |
apt-get update
apt-get install -y --no-install-recommends gcc libpq-dev
rm -rf /var/lib/apt/lists/*
pip install -e ".[dev]"
- name: Type check
run: mypy --python-version 3.12 --strict --ignore-missing-imports --exclude 'build/|dist/|.git/|__pycache__/' *.py
test:
runs-on: docker-x64
container:
image: python:3.12-slim
steps:
- name: Install Node.js for actions/checkout
run: |
apt-get update
apt-get install -y --no-install-recommends curl ca-certificates git
curl -fsSL https://deb.nodesource.com/setup_22.x | bash -
apt-get install -y --no-install-recommends nodejs
rm -rf /var/lib/apt/lists/*
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
cache: pip
cache-dependency-path: pyproject.toml
- run: pip install -e ".[dev]"
- run: pytest tests/ -v --cov=. --cov-report=term-missing --cov-fail-under=40
- name: Install dependencies
run: |
apt-get update
apt-get install -y --no-install-recommends gcc libpq-dev
rm -rf /var/lib/apt/lists/*
pip install -e ".[dev]"
- name: Test
run: pytest tests/ -v --cov=. --cov-report=term-missing --cov-fail-under=40
security:
runs-on: docker-x64
container:
image: python:3.12-slim
steps:
- name: Install Node.js for actions/checkout
run: |
apt-get update
apt-get install -y --no-install-recommends curl ca-certificates git
curl -fsSL https://deb.nodesource.com/setup_22.x | bash -
apt-get install -y --no-install-recommends nodejs
rm -rf /var/lib/apt/lists/*
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
cache: pip
cache-dependency-path: pyproject.toml
- run: pip install bandit
- run: bandit -r . -x tests/,.venv,__pycache__
- name: Install bandit
run: pip install bandit
- name: Bandit
run: bandit -r . -x tests/,.venv,__pycache__
gitleaks:
runs-on: docker-x64
container:
image: python:3.12-slim
steps:
- name: Install Node.js for actions/checkout
run: |
apt-get update
apt-get install -y --no-install-recommends curl ca-certificates git
curl -fsSL https://deb.nodesource.com/setup_22.x | bash -
apt-get install -y --no-install-recommends nodejs
rm -rf /var/lib/apt/lists/*
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: gitleaks/gitleaks-action@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Install gitleaks
run: |
apt-get update
apt-get install -y --no-install-recommends wget git ca-certificates
rm -rf /var/lib/apt/lists/*
wget -qO- https://github.com/gitleaks/gitleaks/releases/download/v8.24.0/gitleaks_8.24.0_linux_x64.tar.gz | tar -xz -C /usr/local/bin gitleaks
- name: Run gitleaks
run: gitleaks detect --source . --redact --no-banner --no-git
commitlint:
if: github.event_name == 'pull_request'
runs-on: docker-x64
container:
image: node:22-slim
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: wagoid/commitlint-github-action@v6
with:
configFile: .commitlintrc.yml
- name: Install commitlint
run: npm install -g @commitlint/cli @commitlint/config-conventional
- name: Run commitlint
run: commitlint --from ${{ github.event.pull_request.base.sha }} --to ${{ github.event.pull_request.head.sha }} --verbose