mirror of
https://github.com/mrclay/minify.git
synced 2025-08-12 00:54:35 +02:00
Use Github actions
This commit is contained in:
54
.github/workflows/php.yml
vendored
Normal file
54
.github/workflows/php.yml
vendored
Normal file
@@ -0,0 +1,54 @@
|
||||
name: PHP Composer
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ "master" ]
|
||||
pull_request:
|
||||
branches: [ "master" ]
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
php-versions:
|
||||
["8.1", "8.2", "8.3"]
|
||||
|
||||
name: PHP ${{ matrix.php-versions }} Test on ubantu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Setup PHP
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: ${{ matrix.php-versions }}
|
||||
coverage: none
|
||||
tools: composer, wp-cli, phpunit-polyfills:1.0
|
||||
env:
|
||||
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- 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: 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: composer run-script test
|
55
.travis.yml
55
.travis.yml
@@ -1,55 +0,0 @@
|
||||
language: php
|
||||
sudo: false
|
||||
dist: trusty
|
||||
|
||||
jobs:
|
||||
fast_finish: true
|
||||
allow_failures:
|
||||
- php: "nightly"
|
||||
- name: "Php CS Fixer"
|
||||
include:
|
||||
- php: "5.3"
|
||||
dist: precise
|
||||
- php: "5.4"
|
||||
- php: "5.5"
|
||||
- php: "5.6"
|
||||
- php: "7.0"
|
||||
- php: "7.1"
|
||||
- php: "7.2"
|
||||
- php: "7.3"
|
||||
- php: "7.4"
|
||||
- php: "nightly"
|
||||
- name: "Php CS Fixer"
|
||||
php: "7.3"
|
||||
env:
|
||||
- PHP_CS_FIXER=1
|
||||
|
||||
env:
|
||||
- CLOSURE_VERSION: 20161024
|
||||
|
||||
services:
|
||||
- memcached
|
||||
|
||||
cache:
|
||||
directories:
|
||||
- $HOME/.composer/cache
|
||||
- vendor
|
||||
|
||||
install:
|
||||
- composer update --no-interaction --prefer-source
|
||||
|
||||
before_script:
|
||||
- tests/dl-closure.sh
|
||||
|
||||
script:
|
||||
- PATH=vendor/bin:$PATH
|
||||
- composer validate
|
||||
- |
|
||||
if [ "$PHP_CS_FIXER" ]; then
|
||||
composer config --unset platform.php
|
||||
composer require --dev friendsofphp/php-cs-fixer:2.16
|
||||
php-cs-fixer fix --verbose --diff --dry-run --ansi
|
||||
fi
|
||||
- vendor/bin/phpunit --verbose
|
||||
|
||||
# vim:ts=2:sw=2:et
|
Reference in New Issue
Block a user