Skip to content

Commit

Permalink
#298: Add a Github Actions Workflow to run tests, replacing Travis
Browse files Browse the repository at this point in the history
  • Loading branch information
m4olivei authored Sep 10, 2021
2 parents caa6797 + 47431cc commit 7f4c873
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 28 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -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
23 changes: 0 additions & 23 deletions .travis.yml

This file was deleted.

12 changes: 7 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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"
}
}

0 comments on commit 7f4c873

Please sign in to comment.