From 68722b2c2247a18ae081feb6191efd7197419828 Mon Sep 17 00:00:00 2001 From: cryptorugmunch Date: Fri, 3 Jul 2026 18:09:07 +0200 Subject: [PATCH] ci(forgejo): use python containers and pip --- .forgejo/workflows/ci.yml | 122 ++++++++++++++++++++++++++------------ 1 file changed, 85 insertions(+), 37 deletions(-) diff --git a/.forgejo/workflows/ci.yml b/.forgejo/workflows/ci.yml index 5b23e9a..27ae4ce 100644 --- a/.forgejo/workflows/ci.yml +++ b/.forgejo/workflows/ci.yml @@ -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