name: Dependencies checks

on:
  schedule:
    - cron:  '0 9 * * 1-5'
  push:
    branches:
      - main
  pull_request:

jobs:
  composer_outdated:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: shivammathur/setup-php@v2
        with:
          php-version: "8.1"
          tools: composer
        env:
          COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
      - run: composer install
      - run: composer outdated -D --strict --no-dev

  security_check:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: shivammathur/setup-php@v2
        with:
          php-version: "8.1"
          tools: composer
      - run: composer install
      - run: php vendor/bin/security-checker security:check composer.lock
