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

cache:
  key: ${CI_COMMIT_REF_SLUG}
  paths:
    - .m2/repository/
    - target/
    - .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: []
  script:
    - cd backend
    - yarn
    - yarn prettier --check .
  retry: 1

Typescript-compile:
  image: node:16.10.0
  stage: backend build
  needs: []
  script:
      - cd backend
      - yarn
      - yarn tsc

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
      - yarn start:local & sleep 10
      - yarn test
  retry: 1
  artifacts:
    paths:
      - cypress/videos/*.mp4
    expire_in: 1 week # Set the artifact expiration time according to your needs
  only:
    refs:
      - main