Skip to content

Commit efa1dd9

Browse files
CI Generator (alexjustesen#578)
Co-authored-by: Shift <[email protected]>
1 parent b292909 commit efa1dd9

File tree

10 files changed

+365
-455
lines changed

10 files changed

+365
-455
lines changed

.github/workflows/ci.yml

Lines changed: 0 additions & 53 deletions
This file was deleted.

.github/workflows/lint.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Lint
2+
on:
3+
- push
4+
- workflow_dispatch
5+
jobs:
6+
lint:
7+
name: Lint
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Checkout
11+
uses: actions/checkout@v2
12+
- name: Setup PHP
13+
uses: shivammathur/setup-php@v2
14+
with:
15+
php-version: '8.1'
16+
tools: phplint, laravel/pint
17+
- name: Check syntax
18+
run: phplint .
19+
- name: Check code style
20+
run: pint --test

.github/workflows/test.yml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
name: Test
2+
on:
3+
- push
4+
- workflow_dispatch
5+
jobs:
6+
test:
7+
strategy:
8+
matrix:
9+
operating-system:
10+
- ubuntu-latest
11+
php-version:
12+
- '8.1'
13+
name: php ${{ matrix.php-version }} on ${{ matrix.operating-system }}
14+
services:
15+
mysql:
16+
image: mysql:8.0
17+
env:
18+
MYSQL_ALLOW_EMPTY_PASSWORD: yes
19+
MYSQL_DATABASE: test
20+
ports:
21+
- 3306:3306
22+
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
23+
runs-on: ${{ matrix.operating-system }}
24+
steps:
25+
- name: Checkout
26+
uses: actions/checkout@v2
27+
- name: Setup PHP
28+
uses: shivammathur/setup-php@v2
29+
with:
30+
php-version: ${{ matrix.php-version }}
31+
extensions: bcmath, ctype, fileinfo, json, mbstring, openssl, pdo, tokenizer, xml
32+
coverage: xdebug
33+
- name: Prepare the environment
34+
run: cp .env.example .env
35+
- name: Get composer cache directory
36+
id: composer-cache
37+
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
38+
- name: Setup composer cache
39+
uses: actions/cache@v3
40+
with:
41+
path: ${{ steps.composer-cache.outputs.dir }}
42+
key: ${{ runner.os }}-composer-${{ hashFiles('composer.lock') }}
43+
restore-keys: ${{ runner.os }}-composer-
44+
- name: Install composer dependencies
45+
env:
46+
COMPOSER_AUTH: ${{ secrets.COMPOSER_AUTH }}
47+
run: composer install --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist
48+
- name: Install application
49+
run: php artisan app:install --force
50+
env:
51+
DB_CONNECTION: mysql
52+
DB_HOST: 127.0.0.1
53+
DB_PORT: ${{ job.services.mysql.ports['3306'] }}
54+
DB_USERNAME: root
55+
DB_DATABASE: test
56+
DB_PASSWORD: null
57+
- name: Run tests
58+
run: php artisan test
59+
env:
60+
DB_CONNECTION: mysql
61+
DB_HOST: 127.0.0.1
62+
DB_PORT: ${{ job.services.mysql.ports['3306'] }}
63+
DB_USERNAME: root
64+
DB_DATABASE: test
65+
DB_PASSWORD: null

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,5 @@ npm-debug.log
1515
yarn-error.log
1616
/.idea
1717
/.vscode
18+
19+
/.phpunit.cache

.phpunit.result.cache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"version":1,"defects":[],"times":{"Tests\\Unit\\ExampleTest::test_that_true_is_true":0.001,"Tests\\Feature\\ExampleTest::test_the_application_returns_a_successful_response":0.125}}
1+
{"version":1,"defects":[],"times":{"Tests\\Unit\\ExampleTest::test_that_true_is_true":0.005,"Tests\\Feature\\ExampleTest::test_the_application_returns_a_successful_response":0.082}}

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
"laravel/sail": "^1.18",
3333
"mockery/mockery": "^1.4.4",
3434
"nunomaduro/collision": "^7.0",
35-
"phpunit/phpunit": "^9.5.10",
35+
"phpunit/phpunit": "^10.0",
3636
"spatie/laravel-ignition": "^2.0"
3737
},
3838
"autoload": {

0 commit comments

Comments
 (0)