Skip to content
Snippets Groups Projects
.gitlab-ci.yml 3.94 KiB
stages:
  - backend build
  - frontend build
  - backend test
  - frontend test
  - deploy

cache:
  key: ${CI_COMMIT_REF_SLUG}
  paths:
    - .m2/repository/
    - target/
    - backend/node_modules/
    - .yarn
    - android-sdk/
    - .gradle/wrapper
    - .gradle/caches

variables:
  # Specify the SDK tools version and build tools version to use
  ANDROID_COMPILE_SDK: 33
  ANDROID_BUILD_TOOLS: 33.0.0
  ANDROID_SDK_TOOLS: 7583922
  ANDROID_HOME: "/usr/local/android-sdk"
  GIT_STRATEGY: clone


Prettier:
  image: node:16.10.0
  stage: backend test
  needs: []
  allow_failure: true
  script:
    - cd backend
    - npm i
    - npx prettier --check .
  retry: 1
  rules:
    - if: '($CI_PIPELINE_SOURCE == "push" || $CI_COMMIT_BRANCH == "main") && $CI_PIPELINE_SOURCE != "schedule"'

Typescript-compile:
  image: node:16.10.0
  stage: backend build
  needs: []
  script:
      - cd backend
      - yarn --cache-folder ../.yarn
      - yarn tsc
  rules:
    - if: '($CI_PIPELINE_SOURCE == "push" || $CI_COMMIT_BRANCH == "main") && $CI_PIPELINE_SOURCE != "schedule"'

API-test:
  image: cypress/base:14.17.0
  stage: backend test
  needs: [Typescript-compile]
  variables:
    DISPLAY: ":99"
  script:
      - apt-get update && apt-get install -y xvfb
      - Xvfb :99 -screen 0 1920x1080x24 &
      - cd backend
      - echo "FB_PRIV_KEY_JSON_ENCODED=$FB_PRIV_KEY_JSON_ENCODED" >> .env
      # - echo "export FB_PRIV_KEY_JSON_ENCODED=$FB_PRIV_KEY_JSON_ENCODED"
      - node keys/decode.js
      - chmod 400 keys/fb-key.json
      - yarn --cache-folder ../.yarn
      - yarn start:local & sleep 10
      - yarn test
  retry: 1
  artifacts: