# This file is a template, and might need editing before it works on your project. # Official framework image. Look for the different tagged releases at: # https://hub.docker.com/r/library/node/tags/ image: node:18 stages: - check-changelog - lint - build - test - deploy # https://git.pleroma.social/help/ci/yaml/workflow.md#switch-between-branch-pipelines-and-merge-request-pipelines workflow: rules: - if: $CI_PIPELINE_SOURCE == "merge_request_event" - if: $CI_COMMIT_BRANCH && $CI_OPEN_MERGE_REQUESTS when: never - if: $CI_COMMIT_BRANCH check-changelog: stage: check-changelog image: alpine rules: - if: $CI_MERGE_REQUEST_SOURCE_PROJECT_PATH == 'pleroma/pleroma-fe' && $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME =~ /^renovate/ when: never - if: $CI_MERGE_REQUEST_SOURCE_PROJECT_PATH == 'pleroma/pleroma-fe' && $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME == 'weblate' when: never - if: $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "develop" before_script: '' after_script: '' cache: {} script: - apk add git - sh ./tools/check-changelog lint: stage: lint script: - yarn - yarn lint - yarn stylelint test: stage: test tags: - amd64 - himem variables: APT_CACHE_DIR: apt-cache script: - mkdir -pv $APT_CACHE_DIR && apt-get -qq update - yarn - yarn playwright install firefox - yarn playwright install-deps - yarn unit-ci artifacts: # When the test fails, upload screenshots for better context on why it fails paths: - test/**/__screenshots__ when: on_failure e2e-pleroma: stage: test image: docker:26 services: - name: docker:26-dind tags: - amd64 - himem variables: DOCKER_HOST: tcp://docker:2375 DOCKER_TLS_CERTDIR: "" DOCKER_DRIVER: overlay2 script: - docker version - docker compose version - echo "$CI_REGISTRY_PASSWORD" | docker login -u "$CI_REGISTRY_USER" --password-stdin "$CI_REGISTRY" - export PLEROMA_IMAGE="${PLEROMA_IMAGE:-$CI_REGISTRY/pleroma/pleroma:stable}" - docker compose -f docker-compose.e2e.yml up --build --remove-orphans --abort-on-container-exit --exit-code-from e2e after_script: - docker compose -f docker-compose.e2e.yml cp e2e:/app/test/e2e-playwright/test-results test/e2e-playwright/test-results || true - docker compose -f docker-compose.e2e.yml cp e2e:/app/test/e2e-playwright/playwright-report test/e2e-playwright/playwright-report || true - docker compose -f docker-compose.e2e.yml down -v --remove-orphans || true artifacts: when: on_failure paths: - test/e2e-playwright/test-results - test/e2e-playwright/playwright-report build: stage: build tags: - amd64 - himem script: - yarn - yarn build artifacts: paths: - dist/ docs-deploy: stage: deploy image: alpine:latest only: - develop@pleroma/pleroma-fe before_script: - apk add curl script: - curl -X POST -F"token=$DOCS_PIPELINE_TRIGGER" -F'ref=master' https://git.pleroma.social/api/v4/projects/673/trigger/pipeline