diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 00000000..eb20eac5 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,49 @@ +name: Test + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + test: + name: Test + runs-on: ubuntu-latest + + strategy: + matrix: + php-versions: ['5.6', '7.0', '7.1', '7.2', '7.3', '7.4'] + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php-versions }} + + - name: Validate composer.json and composer.lock + run: composer validate --strict + + - name: Cache Composer packages + id: composer-cache + uses: actions/cache@v2 + 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 + + - name: Upload composer.lock + uses: actions/upload-artifact@v2 + with: + name: composer.lock + path: composer.lock + + - name: Run test suite + run: composer test diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 5f0a043e..00000000 --- a/.travis.yml +++ /dev/null @@ -1,23 +0,0 @@ -language: php -dist: trusty - -php: - - 5.5 - - 5.6 - - 7.0 - - 7.1 - - 7.2 - - 7.3 - - 7.4 - - nightly - -before_script: - - composer install - -script: - - vendor/bin/phpunit tests - -matrix: - fast_finish: true - allow_failures: - - php: nightly diff --git a/composer.json b/composer.json index 880a9395..8fc6db67 100644 --- a/composer.json +++ b/composer.json @@ -10,9 +10,9 @@ "license": "Apache-2.0", "keywords": ["Drupal", "AMP", "mobile"], "homepage": "https://github.com/Lullabot/amp-library", - "require" : { - "php" : ">=5.5", - "querypath/querypath": ">=3.0.4", + "require": { + "php": ">=5.6", + "querypath/querypath": "^3.0.4", "sebastian/diff": "^1.2 || ^2 || ^3", "marc1706/fast-image-size": "1.*", "sabberworm/php-css-parser": "^8.0.0", @@ -24,8 +24,10 @@ "psr-4": {"Lullabot\\AMP\\": "src"} }, "require-dev": { - "php" : ">=5.5", - "phpunit/phpunit": "4.8.* || ^6", + "phpunit/phpunit": "^5.6.3 || ^6", "symfony/console": "^2.7.0" + }, + "scripts": { + "test": "phpunit tests" } }