# CI for Go Services # Runs on push to main or PRs — builds and tests all Go services # Compatible with both Forgejo Actions and GitHub Actions name: Go Services CI on: push: branches: [main] paths: - 'services/mana-search/**' - 'services/mana-notify/**' - 'services/mana-crawler/**' - 'services/mana-api-gateway/**' - 'services/mana-sync/**' - 'services/mana-matrix-bot/**' pull_request: paths: - 'services/mana-search/**' - 'services/mana-notify/**' - 'services/mana-crawler/**' - 'services/mana-api-gateway/**' - 'services/mana-sync/**' - 'services/mana-matrix-bot/**' jobs: test: runs-on: ubuntu-latest strategy: matrix: service: - mana-search - mana-notify - mana-crawler - mana-api-gateway - mana-sync steps: - uses: actions/checkout@v4 - uses: actions/setup-go@v5 with: go-version: '1.25' - name: Test ${{ matrix.service }} run: | cd services/${{ matrix.service }} go vet ./... go test ./... -v -count=1 - name: Build ${{ matrix.service }} run: | cd services/${{ matrix.service }} CGO_ENABLED=0 go build -ldflags="-s -w" -o /dev/null ./cmd/server docker: needs: test runs-on: ubuntu-latest if: github.event_name == 'push' && github.ref == 'refs/heads/main' strategy: matrix: include: - service: mana-search image: mana-search - service: mana-notify image: mana-notify - service: mana-crawler image: mana-crawler - service: mana-api-gateway image: mana-api-gateway steps: - uses: actions/checkout@v4 - name: Build Docker image run: | docker build \ -f services/${{ matrix.service }}/Dockerfile \ -t ${{ matrix.image }}:${{ github.sha }} \ -t ${{ matrix.image }}:latest \ .