All checks were successful
CI / test (push) Successful in 6s
CI / build-ai-gateway (push) Successful in 50s
CI / build-ha-gateway (push) Successful in 50s
CI / build-discord-bot (push) Successful in 1m3s
CI / build-tts-gateway (push) Successful in 5m32s
CI / build-tts-sidecar (push) Successful in 17m17s
180 lines
4.8 KiB
YAML
180 lines
4.8 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
pull_request:
|
|
branches: [main]
|
|
workflow_dispatch:
|
|
|
|
env:
|
|
REGISTRY: gitea.nik4nao.com
|
|
IMAGE_PREFIX: gitea.nik4nao.com/nik
|
|
GOPATH: /tmp/go
|
|
GOMODCACHE: /tmp/go/pkg/mod
|
|
GOCACHE: /tmp/go-build
|
|
|
|
jobs:
|
|
test:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
|
|
- name: prepare go cache dirs
|
|
run: mkdir -p "$GOMODCACHE" "$GOCACHE"
|
|
|
|
- uses: actions/setup-go@v6
|
|
with:
|
|
go-version-file: go.work
|
|
cache-dependency-path: |
|
|
go.work.sum
|
|
ai-gateway/go.sum
|
|
ha-gateway/go.sum
|
|
discord-bot/go.sum
|
|
tts-gateway/go.sum
|
|
gen/go.sum
|
|
|
|
- name: go vet
|
|
run: |
|
|
cd gen && go vet ./...
|
|
cd ../ai-gateway && go vet ./...
|
|
cd ../ha-gateway && go vet ./...
|
|
cd ../discord-bot && go vet ./...
|
|
cd ../tts-gateway && go vet ./...
|
|
|
|
- name: go test
|
|
run: |
|
|
cd gen && go test ./...
|
|
cd ../ai-gateway && go test ./...
|
|
cd ../ha-gateway && go test ./...
|
|
cd ../discord-bot && go test ./...
|
|
cd ../tts-gateway && go test ./...
|
|
|
|
build-ai-gateway:
|
|
needs: test
|
|
if: github.ref == 'refs/heads/main'
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
|
|
- uses: docker/setup-buildx-action@v4
|
|
|
|
- uses: docker/login-action@v4
|
|
with:
|
|
registry: ${{ env.REGISTRY }}
|
|
username: ${{ secrets.REGISTRY_USER }}
|
|
password: ${{ secrets.REGISTRY_PASSWORD }}
|
|
|
|
- uses: docker/build-push-action@v7
|
|
with:
|
|
context: .
|
|
file: ai-gateway/Dockerfile
|
|
push: true
|
|
platforms: linux/amd64
|
|
tags: |
|
|
${{ env.IMAGE_PREFIX }}/ai-gateway:${{ github.sha }}
|
|
${{ env.IMAGE_PREFIX }}/ai-gateway:latest
|
|
|
|
build-ha-gateway:
|
|
needs: test
|
|
if: github.ref == 'refs/heads/main'
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
|
|
- uses: docker/setup-buildx-action@v4
|
|
|
|
- uses: docker/login-action@v4
|
|
with:
|
|
registry: ${{ env.REGISTRY }}
|
|
username: ${{ secrets.REGISTRY_USER }}
|
|
password: ${{ secrets.REGISTRY_PASSWORD }}
|
|
|
|
- uses: docker/build-push-action@v7
|
|
with:
|
|
context: .
|
|
file: ha-gateway/Dockerfile
|
|
push: true
|
|
platforms: linux/amd64
|
|
tags: |
|
|
${{ env.IMAGE_PREFIX }}/ha-gateway:${{ github.sha }}
|
|
${{ env.IMAGE_PREFIX }}/ha-gateway:latest
|
|
|
|
build-discord-bot:
|
|
needs: test
|
|
if: github.ref == 'refs/heads/main'
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
|
|
- uses: docker/setup-buildx-action@v4
|
|
|
|
- uses: docker/login-action@v4
|
|
with:
|
|
registry: ${{ env.REGISTRY }}
|
|
username: ${{ secrets.REGISTRY_USER }}
|
|
password: ${{ secrets.REGISTRY_PASSWORD }}
|
|
|
|
- uses: docker/build-push-action@v7
|
|
with:
|
|
context: .
|
|
file: discord-bot/Dockerfile
|
|
push: true
|
|
platforms: linux/amd64
|
|
tags: |
|
|
${{ env.IMAGE_PREFIX }}/discord-bot:${{ github.sha }}
|
|
${{ env.IMAGE_PREFIX }}/discord-bot:latest
|
|
|
|
build-tts-gateway:
|
|
needs: test
|
|
if: github.ref == 'refs/heads/main'
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
|
|
- uses: docker/setup-buildx-action@v4
|
|
|
|
- uses: docker/login-action@v4
|
|
with:
|
|
registry: ${{ env.REGISTRY }}
|
|
username: ${{ secrets.REGISTRY_USER }}
|
|
password: ${{ secrets.REGISTRY_PASSWORD }}
|
|
|
|
- uses: docker/build-push-action@v7
|
|
with:
|
|
context: .
|
|
file: tts-gateway/Dockerfile
|
|
push: true
|
|
platforms: linux/amd64
|
|
tags: |
|
|
${{ env.IMAGE_PREFIX }}/tts-gateway:${{ github.sha }}
|
|
${{ env.IMAGE_PREFIX }}/tts-gateway:latest
|
|
|
|
build-tts-sidecar:
|
|
needs: test
|
|
if: github.ref == 'refs/heads/main'
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
|
|
- uses: docker/setup-buildx-action@v4
|
|
|
|
- uses: docker/login-action@v4
|
|
with:
|
|
registry: ${{ env.REGISTRY }}
|
|
username: ${{ secrets.REGISTRY_USER }}
|
|
password: ${{ secrets.REGISTRY_PASSWORD }}
|
|
|
|
# CUDA base image makes this a large (~13GB) build/push - it doesn't
|
|
# need a GPU to build (only to usefully run), but expect this job to be
|
|
# the slowest one in the pipeline by a wide margin.
|
|
- uses: docker/build-push-action@v7
|
|
with:
|
|
context: tts-gateway/sidecar
|
|
file: tts-gateway/sidecar/Dockerfile
|
|
push: true
|
|
platforms: linux/amd64
|
|
tags: |
|
|
${{ env.IMAGE_PREFIX }}/tts-sidecar:${{ github.sha }}
|
|
${{ env.IMAGE_PREFIX }}/tts-sidecar:latest
|