name: Pantheon WP EI Lint and Test
on:
  push:
    # This job is copied in build.yml so we can use the
    # needs: test dependency on the build job.
    # Cross workflow dependencies are not yet supported:
    # https://github.community/t/how-do-i-specify-job-dependency-running-in-another-workflow/16482
    branches-ignore:
      - build
      - 'release-**'
jobs:
  test:
    runs-on: ubuntu-latest
    name: Lint and Test
    steps:
    - uses: actions/checkout@v3
    - uses: shogo82148/actions-setup-mysql@v1
      with:
        mysql-version: 'mariadb-10.9'
        root-password: ''
    - name: Start MariaDB
      run: mysql -uroot -h127.0.0.1 -e 'SELECT version()'
    - name: Install dependencies
      run: composer install
    - name: Install WP Unit
      run: composer test:install-wp-unit
    - name: Run lint
      run: composer lint
    - name: Run unit tests
      run: composer test
