normogen/.forgejo/workflows/lint-and-build.yml
goose 856f86e72d
Some checks are pending
Lint and Build / Lint (push) Waiting to run
Lint and Build / Build (push) Blocked by required conditions
Lint and Build / Docker Build (push) Blocked by required conditions
fix(ci): simplify workflow to avoid external GitHub actions
The previous workflow was getting stuck because it was trying to pull
actions from GitHub (https://github.com/actions/cache@v3) which can
cause connectivity and compatibility issues in Forgejo.

Changes:
- Remove all external GitHub action dependencies except checkout
- Use Forgejo's built-in checkout@v4 action
- Remove caching steps (can be added later with Forgejo-native actions)
- Add explicit dependency installation step
- Use 'cargo build --release' for better optimization

This should make the CI more reliable and faster to start.
2026-03-12 08:21:42 -03:00

86 lines
1.8 KiB
YAML

name: Lint and Build
on:
push:
branches:
- main
- develop
pull_request:
branches:
- main
- develop
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
container:
image: rust:latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install dependencies
run: |
apt-get update && apt-get install -y pkg-config libssl-dev
- name: Run rustfmt
working-directory: ./backend
run: |
cargo fmt --all -- --check
- name: Run clippy
working-directory: ./backend
run: |
cargo clippy --all-targets --all-features -- -D warnings
build:
name: Build
runs-on: ubuntu-latest
container:
image: rust:latest
needs: lint
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install dependencies
run: |
apt-get update && apt-get install -y pkg-config libssl-dev
- name: Build project
working-directory: ./backend
run: |
cargo build --release --verbose
- name: Run tests
working-directory: ./backend
run: |
cargo test --verbose
docker-build:
name: Docker Build
runs-on: ubuntu-latest
container:
image: docker:latest
needs: build
services:
docker:
image: docker:dind
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Build Docker image
working-directory: ./backend
run: |
docker build -f docker/Dockerfile -t normogen-backend:test .
- name: Build Docker image (dev)
working-directory: ./backend
run: |
docker build -f docker/Dockerfile.dev -t normogen-backend:dev-test .