normogen/.forgejo/workflows/lint-and-build.yml
goose a57bfca6cf
Some checks failed
Lint and Build / format (push) Successful in 34s
Lint and Build / clippy (push) Has been cancelled
Lint and Build / build (push) Has been cancelled
fix(ci): remove docker-build due to DNS/network issues with DinD
- Remove Docker build step from CI pipeline
- DinD services have DNS resolution issues in Forgejo's temporary networks
- Each job runs in isolated network, cannot resolve service hostnames
- Format, Clippy, and Build jobs remain fully functional
- Docker builds should be done separately:
  * Locally for development
  * Via deployment scripts on Solaria
  * When proper BuildKit support is available

This is a pragmatic solution that focuses on what CI can do well:
code quality checks and binary compilation.
2026-03-18 23:26:27 -03:00

109 lines
3.4 KiB
YAML

name: Lint and Build
on:
push:
branches: [main, develop]
pull_request:
branches: [main, develop]
jobs:
# ==============================================================================
# Job 1: Format Check
# ==============================================================================
format:
runs-on: docker
container:
image: rust:latest
steps:
- name: Install Node.js for checkout
run: |
apt-get update
apt-get install -y curl gnupg
curl -fsSL https://deb.nodesource.com/setup_20.x | bash -
apt-get install -y nodejs
- name: Checkout code
uses: actions/checkout@v4
- name: Install dependencies
run: |
apt-get update
apt-get install -y pkg-config libssl-dev
rustup component add rustfmt
- name: Check formatting
working-directory: ./backend
run: cargo fmt --all -- --check
# ==============================================================================
# Job 2: Lint
# ==============================================================================
clippy:
runs-on: docker
container:
image: rust:latest
steps:
- name: Install Node.js for checkout
run: |
apt-get update
apt-get install -y curl gnupg
curl -fsSL https://deb.nodesource.com/setup_20.x | bash -
apt-get install -y nodejs
- name: Checkout code
uses: actions/checkout@v4
- name: Install dependencies
run: |
apt-get update
apt-get install -y pkg-config libssl-dev
rustup component add clippy
- name: Run Clippy
working-directory: ./backend
run: cargo clippy --all-targets --all-features
# ==============================================================================
# Job 3: Build - Depends on format and clippy
# ==============================================================================
build:
runs-on: docker
container:
image: rust:latest
needs: [format, clippy]
steps:
- name: Install Node.js for checkout
run: |
apt-get update
apt-get install -y curl gnupg
curl -fsSL https://deb.nodesource.com/setup_20.x | bash -
apt-get install -y nodejs
- name: Checkout code
uses: actions/checkout@v4
- name: Install dependencies
run: |
apt-get update
apt-get install -y pkg-config libssl-dev
- name: Build release binary
working-directory: ./backend
run: cargo build --release --verbose
# ==============================================================================
# NOTE: Docker build disabled due to DNS/network issues with DinD services
#
# The Forgejo runner creates temporary networks for each job, causing
# DNS resolution issues when trying to connect to DinD services.
#
# Docker builds should be done separately:
# - Locally: docker build -f backend/docker/Dockerfile -t normogen-backend:latest
# - On Solaria: Use deployment scripts in docs/deployment/
#
# Future solution: Configure Forgejo runner with Docker-in-Docker properly
# or use a container registry with proper BuildKit support.
# ==============================================================================