variables:
  GIT_SUBMODULE_STRATEGY: recursive

# Linting stage
Lint:
  rules:
    - if: $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME =~ /^feature/ && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "develop"
      when: always
  stage: lint
  tags:
    - macos
    - flutter
  script:
    - chmod +x ./toolchain/linting.sh
    - ./toolchain/linting.sh nut_player

# Testing stage
Tests:
  rules:
    - if: $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME =~ /^feature/ && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "develop"
      when: on_success
      allow_failure: false
  stage: test
  tags:
    - macos
    - flutter
  script:
    - chmod +x ./toolchain/testing.sh
    - ./toolchain/testing.sh nut_player

# Build Application
mrBuildApplication:
  rules:
    - if: $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME =~ /^feature/ && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "develop"
      when: on_success
      allow_failure: false
  tags:
    - macos
    - flutter
  stage: build
  needs:
    - job: Tests
  script:
    - chmod +x ./toolchain/build_platforms.sh
    - ./toolchain/build_platforms.sh nut_player simulator