Skip to content

Tests

Tests #82

Workflow file for this run

name: Tests
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
schedule:
# To detect any changes on the API we run the test suite every week on Mondays.
- cron: '0 7 * * MON'
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php-versions: ['7.1', '7.2', '7.3', '8.0']
env:
YOUTUBE_API_KEY: ${{secrets.YOUTUBE_API_KEY}}
name: Testing on PHP ${{ matrix.php-versions }}
steps:
- uses: actions/checkout@v3
- name: Validate composer.json and composer.lock
run: composer validate --strict
- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v3
with:
path: vendor
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
- name: Install dependencies
run: composer install --prefer-dist --no-progress
# Add a test script to composer.json, for instance: "test": "vendor/bin/phpunit"
# Docs: https://getcomposer.org/doc/articles/scripts.md
- name: Run test suite
run: ./vendor/bin/phpunit