Skip to content

Commit

Permalink
Migrate unit tests to GH actions
Browse files Browse the repository at this point in the history
  • Loading branch information
imjoehaines committed Oct 13, 2020
1 parent fe049f5 commit 2b6a48b
Show file tree
Hide file tree
Showing 4 changed files with 118 additions and 160 deletions.
112 changes: 112 additions & 0 deletions .github/workflows/test-package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
name: test

on:
push:
pull_request:
schedule:
- cron: '0 0 * * *'

jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- php-version: 5.5.9
laravel-version: '5.1.*'
composer-flags: '--prefer-lowest'
- php-version: 5.5
laravel-version: '5.1.*'
- php-version: 5.5
laravel-version: '5.2.*'
- php-version: 5.6
laravel-version: '5.1.*'
- php-version: 5.6
laravel-version: '5.2.*'
- php-version: 5.6
laravel-version: '5.3.*'
- php-version: 5.6
laravel-version: '5.4.*'
- php-version: 7.0
laravel-version: '5.1.*'
- php-version: 7.0
laravel-version: '5.2.*'
- php-version: 7.0
laravel-version: '5.3.*'
- php-version: 7.0
laravel-version: '5.4.*'
- php-version: 7.0
laravel-version: '5.5.*'
- php-version: 7.1
laravel-version: '5.3.*'
- php-version: 7.1
laravel-version: '5.4.*'
- php-version: 7.1
laravel-version: '5.5.*'
- php-version: 7.1
laravel-version: '5.6.*'
- php-version: 7.1
laravel-version: '5.7.*'
- php-version: 7.1
laravel-version: '5.8.*'
- php-version: 7.2
laravel-version: '5.5.*'
- php-version: 7.2
laravel-version: '5.6.*'
- php-version: 7.2
laravel-version: '5.7.*'
- php-version: 7.2
laravel-version: '5.8.*'
- php-version: 7.2
laravel-version: '6.0'
- php-version: 7.2
laravel-version: '7.0'
- php-version: 7.2
laravel-version: '6.*'
- php-version: 7.2
laravel-version: '7.*'
- php-version: 7.3
laravel-version: '5.5.*'
- php-version: 7.3
laravel-version: '5.6.*'
- php-version: 7.3
laravel-version: '5.7.*'
- php-version: 7.3
laravel-version: '5.8.*'
- php-version: 7.3
laravel-version: '6.*'
- php-version: 7.3
laravel-version: '7.*'
- php-version: 7.3
laravel-version: '8.*'
- php-version: 7.4
laravel-version: '5.8.*'
- php-version: 7.4
laravel-version: '6.0'
- php-version: 7.4
laravel-version: '7.0'
- php-version: 7.4
laravel-version: '6.*'
- php-version: 7.4
laravel-version: '7.*'
- php-version: 7.4
laravel-version: '8.*'

steps:
- uses: actions/checkout@v2

- name: install PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}

- run: composer validate

- name: require Laravel
run: composer require "laravel/framework:${{ matrix.laravel-version }}" --no-update

- name: install dependencies
run: composer update --prefer-dist --no-progress --no-suggest --no-interaction ${{ matrix.composer-flags }}

- run: composer test
159 changes: 1 addition & 158 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,167 +4,10 @@ stages:
# Run tests against unstable Laravel versions for builds triggered by a cron
- name: Unstable
if: type = cron
- Canary
- Test
- Maze Runner

matrix:
include:
- php: 5.5.9
dist: trusty
env: LARAVEL_VERSION=5.1.*
stage: Canary
- php: 5.5
dist: trusty
env: LARAVEL_VERSION=5.1.*
stage: Canary
- php: 5.5
dist: trusty
env: LARAVEL_VERSION=5.2.*
stage: Canary
- php: 5.6
dist: xenial
env: LARAVEL_VERSION=5.1.*
stage: Test
- php: 5.6
dist: xenial
env: LARAVEL_VERSION=5.2.*
stage: Test
- php: 5.6
dist: xenial
env: LARAVEL_VERSION=5.3.*
stage: Canary
- php: 5.6
dist: xenial
env: LARAVEL_VERSION=5.4.*
stage: Canary
- php: 7.0
dist: xenial
env: LARAVEL_VERSION=5.1.*
stage: Test
- php: 7.0
dist: xenial
env: LARAVEL_VERSION=5.2.*
stage: Test
- php: 7.0
dist: xenial
env: LARAVEL_VERSION=5.3.*
- php: 7.0
dist: xenial
env: LARAVEL_VERSION=5.4.*
stage: Test
- php: 7.0
dist: xenial
env: LARAVEL_VERSION=5.5.*
stage: Canary
- php: 7.1
dist: bionic
env: LARAVEL_VERSION=5.3.*
stage: Test
- php: 7.1
dist: bionic
env: LARAVEL_VERSION=5.4.*
stage: Test
- php: 7.1
dist: bionic
env: LARAVEL_VERSION=5.5.*
stage: Test
- php: 7.1
dist: bionic
env: LARAVEL_VERSION=5.6.*
stage: Canary
- php: 7.1
dist: bionic
env: LARAVEL_VERSION=5.7.*
stage: Canary
- php: 7.1
dist: bionic
env: LARAVEL_VERSION=5.8.*
stage: Canary
- php: 7.2
dist: bionic
env: LARAVEL_VERSION=5.5.*
stage: Test
- php: 7.2
dist: bionic
env: LARAVEL_VERSION=5.6.*
stage: Test
- php: 7.2
dist: bionic
env: LARAVEL_VERSION=5.7.*
stage: Test
- php: 7.2
dist: bionic
env: LARAVEL_VERSION=5.8.*
stage: Test
- php: 7.2
dist: bionic
env: LARAVEL_VERSION=6.0
stage: Canary
- php: 7.2
dist: bionic
env: LARAVEL_VERSION=7.0
stage: Canary
- php: 7.2
dist: bionic
env: LARAVEL_VERSION=6.*
stage: Test
- php: 7.2
dist: bionic
env: LARAVEL_VERSION=7.*
stage: Test
- php: 7.3
dist: bionic
env: LARAVEL_VERSION=5.5.*
stage: Test
- php: 7.3
dist: bionic
env: LARAVEL_VERSION=5.6.*
stage: Test
- php: 7.3
dist: bionic
env: LARAVEL_VERSION=5.7.*
stage: Test
- php: 7.3
dist: bionic
env: LARAVEL_VERSION=5.8.*
stage: Test
- php: 7.3
dist: bionic
env: LARAVEL_VERSION=6.*
stage: Test
- php: 7.3
dist: bionic
env: LARAVEL_VERSION=7.*
stage: Test
- php: 7.3
dist: bionic
env: LARAVEL_VERSION=8.*
stage: Test
- php: 7.4
dist: bionic
env: LARAVEL_VERSION=5.8.*
stage: Test
- php: 7.4
dist: bionic
env: LARAVEL_VERSION=6.0
stage: Test
- php: 7.4
dist: bionic
env: LARAVEL_VERSION=7.0
stage: Test
- php: 7.4
dist: bionic
env: LARAVEL_VERSION=6.*
stage: Canary
- php: 7.4
dist: bionic
env: LARAVEL_VERSION=7.*
stage: Canary
- php: 7.4
dist: bionic
env: LARAVEL_VERSION=8.*
stage: Canary
- addons:
apt:
packages:
Expand Down Expand Up @@ -245,4 +88,4 @@ install:
- composer show --direct

script:
- make test
- composer test
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ update: ## Update the dependencies
composer update

test: ## Run the test suite
vendor/bin/phpunit
composer test

coverage: ## Record the test coverage
vendor/bin/phpunit --coverage-html=build/coverage
composer test -- --coverage-html=build/coverage

coverage-show: ## Show the test coverage
view-coverage
Expand Down
3 changes: 3 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@
"dev-master": "2.18-dev"
}
},
"scripts": {
"test": "phpunit"
},
"minimum-stability": "dev",
"prefer-stable": true
}

0 comments on commit 2b6a48b

Please sign in to comment.