Skip to content

Commit a85f7ca

Browse files
Merge pull request #1 from codeofdigital/codeofdigital-github-actions-1
Add Github Actions template
2 parents ef5f113 + 9cef762 commit a85f7ca

File tree

4 files changed

+65
-4
lines changed

4 files changed

+65
-4
lines changed

.github/workflows/ci-test.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: run-tests
2+
3+
on:
4+
pull_request:
5+
6+
jobs:
7+
run-tests:
8+
runs-on: ubuntu-latest
9+
strategy:
10+
fail-fast: false
11+
matrix:
12+
php: [7.3, 7.4, 8.0]
13+
laravel: [6.*, 7.*, 8.*]
14+
15+
name: PHP${{ matrix.php }} - Laravel ${{ matrix.laravel }}
16+
17+
steps:
18+
- name: Update apt
19+
run: sudo apt-get update --fix-missing
20+
21+
- name: Checkout code
22+
uses: actions/checkout@v2
23+
24+
- name: Setup PHP
25+
uses: shivammathur/setup-php@v2
26+
with:
27+
php-version: ${{ matrix.php }}
28+
coverage: none
29+
30+
- name: Setup Problem Matches
31+
run: |
32+
echo "::add-matcher::${{ runner.tool_cache }}/php.json"
33+
echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
34+
35+
- name: Install dependencies
36+
run: |
37+
composer require "laravel/framework:${{ matrix.laravel }}" --no-interaction --no-update
38+
composer update --prefer-dist --no-interaction --no-suggest
39+
40+
- name: Execute tests
41+
run: vendor/bin/phpunit

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
vendor/
22
.idea/
33
composer.lock
4-
phpunit.xml
54
.phpunit.result.cache

composer.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,14 @@
2323
}
2424
],
2525
"require": {
26-
"php": "^7.2",
26+
"php": "^7.2|^8.0",
2727
"guzzlehttp/guzzle": "^6.2 || ^7.0",
2828
"guzzlehttp/promises": "^1.0",
2929
"guzzlehttp/psr7": "^1.4",
30-
"illuminate/support": "^5.1 || ^6.0 || ^7.0 || ^8.0",
3130
"psr/http-message": "^1.0"
3231
},
3332
"require-dev": {
34-
"illuminate/routing": "^5.1 || ^6.0 || ^7.0",
33+
"illuminate/routing": "^5.1 || ^6.0 || ^7.0 || ^8.0",
3534
"phpunit/phpunit": "^8.2"
3635
},
3736
"autoload": {

phpunit.xml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<phpunit bootstrap="vendor/autoload.php"
3+
backupGlobals="false"
4+
backupStaticAttributes="false"
5+
colors="true"
6+
verbose="true"
7+
convertErrorsToExceptions="true"
8+
convertNoticesToExceptions="true"
9+
convertWarningsToExceptions="true"
10+
processIsolation="false"
11+
stopOnFailure="false">
12+
<testsuites>
13+
<testsuite name="LaravelUrlShortener">
14+
<directory suffix="Test.php">tests</directory>
15+
</testsuite>
16+
</testsuites>
17+
<filter>
18+
<whitelist processUncoveredFilesFromWhitelist="true">
19+
<directory suffix=".php">src</directory>
20+
</whitelist>
21+
</filter>
22+
</phpunit>

0 commit comments

Comments
 (0)