63 lines
1.6 KiB
YAML
63 lines
1.6 KiB
YAML
name: Backend - Build & Lint
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
paths:
|
|
- "backend/**/**"
|
|
pull_request:
|
|
branches: [main]
|
|
paths:
|
|
- "backend/**/**"
|
|
|
|
jobs:
|
|
lint:
|
|
name: Static Analysis (golangci-lint)
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Setup Go
|
|
uses: actions/setup-go@v5
|
|
with:
|
|
go-version: "1.24.4"
|
|
cache-dependency-path: backend/gestion/go.sum
|
|
|
|
- name: golangci-lint
|
|
uses: golangci/golangci-lint-action@v6
|
|
continue-on-error: true
|
|
with:
|
|
version: latest
|
|
working-directory: backend/gestion
|
|
args: --timeout=5m
|
|
|
|
build:
|
|
name: Build
|
|
needs: lint
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Setup Go
|
|
uses: actions/setup-go@v5
|
|
with:
|
|
go-version: "1.24.4"
|
|
cache-dependency-path: backend/gestion/go.sum
|
|
|
|
- name: Download dependencies
|
|
working-directory: backend/gestion
|
|
run: go mod download
|
|
|
|
- name: Build
|
|
working-directory: backend/gestion
|
|
run: go build -v ./...
|
|
|
|
- name: Upload binary
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: backend-binary
|
|
path: backend/gestion/gestion
|
|
retention-days: 7
|