name: Unit Tests

on: [push]

jobs:

  build:
    runs-on: ubuntu-16.04

    steps:
    - uses: actions/checkout@v1
      with:
        submodules: true

    - name: Install dependencies
      run: |
        npm install

    - name: Run Tests
      run: |
        npm test

    - name: Notify Discord (success)
      uses: appleboy/discord-action@master
      with:
        webhook_id: ${{ secrets.DISCORD_WEBHOOK_ID }}
        webhook_token: ${{ secrets.DISCORD_WEBHOOK_TOKEN }}
        color: "#00C07F"
        message: "https://github.com/openfl/openfl/actions\nNPM unit tests succeeded."

    - name: Notify Discord (failure)
      uses: appleboy/discord-action@master
      if: failure()
      with:
        webhook_id: ${{ secrets.DISCORD_WEBHOOK_ID }}
        webhook_token: ${{ secrets.DISCORD_WEBHOOK_TOKEN }}
        color: "#FF6562"
        message: "https://github.com/openfl/openfl/actions\nNPM unit tests failed."


name: Unit Tests

on: [push, pull_request]

jobs:

  build:
    runs-on: ubuntu-16.04

    steps:
    - uses: actions/checkout@v1
      with:
        submodules: true

    - name: Install dependencies
      run: |
        npm install

    - name: Run Tests
      run: |
        npm test

    - name: Notify Discord (success)
      uses: appleboy/discord-action@master
      with:
        webhook_id: ${{ secrets.DISCORD_WEBHOOK_ID }}
        webhook_token: ${{ secrets.DISCORD_WEBHOOK_TOKEN }}
        color: "#00C07F"
        message: "https://github.com/openfl/openfl/actions\nNPM unit tests succeeded."

    - name: Notify Discord (failure)
      uses: appleboy/discord-action@master
      if: failure()
      with:
        webhook_id: ${{ secrets.DISCORD_WEBHOOK_ID }}
        webhook_token: ${{ secrets.DISCORD_WEBHOOK_TOKEN }}
        color: "#FF6562"
        message: "https://github.com/openfl/openfl/actions\nNPM unit tests failed."


Fix CI not runing on pull requests
Fix CI not runing on pull requests