clone:
  git:
    when:
      event:
        - tag
        - push
        - pull_request
    image: woodpeckerci/plugin-git:2.1.0
    settings:
      depth: 1
      lfs: false
      recursive: false
      tags: true

steps:
  test:
    group: test
    image: danog/madelineproto:next
    when:
      event:
        - tag
    environment:
      API_ID:
        from_secret: API_ID
      API_HASH:
        from_secret: API_HASH
      DEST:
        from_secret: DEST
      BOT_TOKEN:
        from_secret: BOT_TOKEN
    commands:
      - tests/test.sh phpunit
    
  test_light:
    group: test
    image: danog/madelineproto:next
    when:
      event:
        - pull_request
        - push
    commands:
      - tests/test.sh phpunit-light

  handshake:
    group: test
    image: danog/madelineproto:next
    when:
      event:
        - pull_request
        - tag
        - push
    commands:
      - tests/test.sh handshake