normogen/.forgejo/workflows/lint-and-build.yml
goose 803da596e1
Some checks failed
Lint and Build / Lint (push) Failing after 1m27s
Lint and Build / Build (push) Has been skipped
Lint and Build / Docker Build (push) Has been skipped
fix(ci): use correct Forgejo runner label (docker)
The CI was stuck because 'runs-on: ubuntu-latest' doesn't match
any configured Forgejo runner labels.

Forgejo uses 'docker' as the default label for runners that support
containerized jobs. This matches the original workflow configuration
and should be picked up by your Forgejo runner.
2026-03-12 08:38:51 -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: docker
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: docker
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: docker
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 .