The Gitea Actions runners are on ARM64 (pi1/pi3) and Go's ThreadSanitizer fails with 'unsupported VMA range, Found 47 - Supported 48' on those kernels. Race detector is still available locally via `make test-race`.
80 lines
1.9 KiB
YAML
80 lines
1.9 KiB
YAML
---
|
|
name: CI/CD
|
|
|
|
on:
|
|
workflow_dispatch: {}
|
|
push:
|
|
branches:
|
|
- main
|
|
paths-ignore:
|
|
- 'README.md'
|
|
- 'AUTH.md'
|
|
- 'DEPLOY.md'
|
|
- 'HOWTO_ADD_BOT.md'
|
|
- 'chart/**'
|
|
- '.gitignore'
|
|
- 'Makefile'
|
|
- 'bots.example.yaml'
|
|
- 'docker-compose.yml'
|
|
pull_request:
|
|
branches:
|
|
- main
|
|
paths-ignore:
|
|
- 'README.md'
|
|
- 'AUTH.md'
|
|
- 'DEPLOY.md'
|
|
- 'HOWTO_ADD_BOT.md'
|
|
- 'chart/**'
|
|
- '.gitignore'
|
|
- 'docker-compose.yml'
|
|
|
|
concurrency:
|
|
group: ${{ github.ref }}-${{ github.workflow }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
test:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: git checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: setup go
|
|
uses: actions/setup-go@v5
|
|
with:
|
|
go-version: '1.24'
|
|
cache: true
|
|
|
|
- name: go vet
|
|
run: go vet ./...
|
|
|
|
# NOTE: race detector désactivé en CI — les runners Gitea Actions sont
|
|
# sur ARM64 (RPi pi1/pi3) et ThreadSanitizer y échoue en VMA range
|
|
# incompatible. Race est exécuté localement via `make test-race`.
|
|
- name: go test
|
|
run: go test -count=1 -timeout 120s ./...
|
|
|
|
build-and-push-image:
|
|
runs-on: ubuntu-latest
|
|
needs: test
|
|
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
|
|
steps:
|
|
- name: Login to Gitea Container Registry
|
|
uses: docker/login-action@v3
|
|
with:
|
|
registry: gitea.arcodange.lab
|
|
username: ${{ github.actor }}
|
|
password: ${{ secrets.PACKAGES_TOKEN }}
|
|
|
|
- name: git checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Build and push image to Gitea Container Registry
|
|
run: |-
|
|
TAGS="latest ${{ github.ref_name }}"
|
|
docker build -t app .
|
|
for TAG in $TAGS; do
|
|
docker tag app gitea.arcodange.lab/${{ github.repository }}:$TAG
|
|
docker push gitea.arcodange.lab/${{ github.repository }}:$TAG
|
|
done
|