Add github actions

This commit is contained in:
Alexander Schranz 2021-11-27 00:06:57 +01:00
commit d59cb26d91
2 changed files with 72 additions and 69 deletions

72
.github/workflows/test.yaml vendored Normal file
View file

@ -0,0 +1,72 @@
name: Test
on:
pull_request: ~
push:
branches:
- 'master'
schedule:
- cron: "0 0 * * *"
jobs:
test:
name: "Test ${{ matrix.php-version }}"
runs-on: ubuntu-latest
env:
PHPUNIT_VERSION: ${{ matrix.phpunit-version }}
strategy:
fail-fast: false
matrix:
include:
- php-version: '5.3'
phpunit-version: 4
dependency-versions: 'lowest'
- php-version: '5.4'
phpunit-version: 4
- php-version: '5.5'
phpunit-version: 4
- php-version: '5.6'
- php-version: '7.0'
- php-version: '7.1'
- php-version: '7.2'
- php-version: '7.3'
- php-version: '7.4'
- php-version: '8.0'
- php-version: '8.1'
steps:
- name: Checkout project
uses: actions/checkout@v2
- name: Install and configure PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
tools: composer:v2
coverage: none
- name: Install phpunit
if: ${{ matrix.phpunit-version }}
run: |
composer remove symfony/phpunit-bridge --dev
wget -O phpunit "https://phar.phpunit.de/phpunit-${{ matrix.phpunit-version }}.phar"
chmod +x phpunit
- name: Install composer dependencies
uses: ramsey/composer-install@v1
with:
dependency-versions: ${{ matrix.dependency-versions }}
- name: Install ffmpeg
uses: FedericoCarboni/setup-ffmpeg@v1
- name: Run tests
if: ${{ matrix.phpunit-version }}
run: |
if [ "$PHPUNIT_VERSION" ]; then
./phpunit --verbose
else
./vendor/bin/simple-phpunit --verbose
fi;

View file

@ -1,69 +0,0 @@
language: php
dist: trusty
branches:
only:
- master
- v1.x
cache:
directories:
- $HOME/.composer/cache
- $HOME/.cache
matrix:
include:
- php: 5.4
env:
- PHPUNIT_VERSION=4
- COMPOSER_FLAGS="--prefer-lowest"
- php: 5.4
env:
- PHPUNIT_VERSION=4
- php: 5.5
env:
- PHPUNIT_VERSION=4
- php: 5.6
- php: 7.0
- php: 7.1
- php: 7.2
- php: 7.3
- php: 7.4
- php: 8.0
dist: bionic
- php: nightly
env:
- COMPOSER_DEV_STABILITY=true
before_install:
- sudo add-apt-repository ppa:mc3man/${TRAVIS_DIST}-media -y
- sudo apt-get update -q
- composer self-update
- echo "$PHPUNIT_VERSION"
- |
if [ "$PHPUNIT_VERSION" ]; then
composer remove symfony/phpunit-bridge --dev
wget -O phpunit "https://phar.phpunit.de/phpunit-$PHPUNIT_VERSION.phar"
chmod +x phpunit
fi;
- |
if [ "$COMPOSER_FLAGS" == "--prefer-lowest" ]; then
composer require "roave/security-advisories" dev-master --no-update
fi;
- |
if [ "$COMPOSER_DEV_STABILITY" == "true" ]; then
composer config minimum-stability dev
fi;
install:
- sudo apt-get install -y ffmpeg
- composer update --prefer-dist $COMPOSER_FLAGS
script:
- |
if [ "$PHPUNIT_VERSION" ]; then
./phpunit --verbose
else
./vendor/bin/simple-phpunit --verbose
fi;