stages: - build - test - validate - runway_staging - runway_production variables: CONTAINER_IMAGE_COMMIT: $CI_REGISTRY_IMAGE:$CI_COMMIT_SHORT_SHA include: - project: 'gitlab-com/gl-infra/platform/runway/runwayctl' file: 'ci-tasks/service-project/runway.yml' rules: - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH inputs: runway_service_id: sparkle image: "$CONTAINER_IMAGE_COMMIT" runway_version: v3.83.0 build image: image: docker:28 interruptible: true stage: build services: - docker:28-dind before_script: - docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY script: - docker build --no-cache --tag $CONTAINER_IMAGE_COMMIT . - docker push $CONTAINER_IMAGE_COMMIT lint: image: golang:alpine stage: test needs: [] script: - go install github.com/google/yamlfmt/cmd/yamlfmt@latest - yamlfmt -lint -exclude vendor . unit: image: golang:alpine stage: test needs: [] script: - go test ./... schema: image: golang:alpine stage: test needs: [] script: - go install github.com/authzed/zed/cmd/zed@latest - ./bin/tool zed version - ./bin/tool zed validate etc/authzd/*.yaml race: image: golang:latest stage: test needs: [] script: - go test -race -shuffle=on ./... variables: CGO_ENABLED: 1 integration: image: golang:1.24.5 stage: test allow_failure: true needs: - build image services: - name: docker:28-dind command: ["--tls=false"] before_script: - apt-get update && apt-get install --no-install-recommends -y docker.io - echo "$CI_JOB_TOKEN" | docker login -u gitlab-ci-token --password-stdin "$CI_REGISTRY" - docker info script: - go test -v -tags=integration ./test/integration/... variables: # Variables required by github.com/testcontainers/testcontainers-go # ref https://golang.testcontainers.org/system_requirements/ci/gitlab_ci/#example-using-dind-docker-in-docker DOCKER_DRIVER: overlay2 DOCKER_HOST: "tcp://docker:2375" DOCKER_TLS_CERTDIR: "" IMAGE_TAG: $CONTAINER_IMAGE_COMMIT # TESTCONTAINERS_HOST_OVERRIDE: "localhost" # TESTCONTAINERS_RYUK_DISABLED: "true"