version: '3.8'

services:
  act-runner:
    image: gitea/act_runner:latest
    volumes:
      - .:/workspace
      - ./config/runner:/data/.runner
    working_dir: /workspace
    environment:
      - GITEA_INSTANCE_URL=${GITEA_INSTANCE_URL:-https://gitea.arcodange.lab/}
      - GITEA_RUNNER_REGISTRATION_TOKEN=${GITEA_RUNNER_REGISTRATION_TOKEN}
      - GITEA_RUNNER_NAME=${GITEA_RUNNER_NAME:-local-test-runner}
      - GITEA_RUNNER_LABELS=${GITEA_RUNNER_LABELS:-ubuntu-latest:docker://node:16-bullseye,ubuntu-22.04:docker://gitea/act_runner:latest}
    command: act -W .gitea/workflows/go-ci-cd.yaml --rm

  yamllint:
    image: pipelinecomponents/yamllint:latest
    volumes:
      - .:/workspace
    working_dir: /workspace
    command: yamllint .gitea/workflows/

  yq-validator:
    image: mikefarah/yq:latest
    volumes:
      - .:/workspace
    working_dir: /workspace
    command: yq eval '.' .gitea/workflows/ci-cd.yaml