Skip to content

Commit bb0a55a

Browse files
authored
Merge pull request #8 from kduma-OSS/feature/test-on-push
Configure automatic test running on GitHub actions
2 parents 279d134 + 12a176e commit bb0a55a

4 files changed

Lines changed: 49 additions & 9 deletions

File tree

.github/workflows/pest.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Test Pest Testsuite
2+
3+
on:
4+
push:
5+
branches: [ "main", "develop" ]
6+
pull_request:
7+
branches: [ "main", "develop" ]
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
test-pest:
14+
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- uses: actions/checkout@v3
19+
20+
- name: Validate composer.json and composer.lock
21+
run: composer validate --strict
22+
23+
- name: Cache Composer packages
24+
id: composer-cache
25+
uses: actions/cache@v3
26+
with:
27+
path: vendor
28+
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
29+
restore-keys: |
30+
${{ runner.os }}-php-
31+
32+
- name: Install dependencies
33+
run: composer install --prefer-dist --no-progress
34+
35+
# Add a test script to composer.json, for instance: "test": "vendor/bin/phpunit"
36+
# Docs: https://getcomposer.org/doc/articles/scripts.md
37+
38+
- name: Run test suite
39+
run: composer run-script test-pest

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@
4444
},
4545
"scripts": {
4646
"pint": "@php vendor/bin/pint -v",
47-
"test-pint": "@php vendor/bin/pint -v --test"
47+
"test-pint": "@php vendor/bin/pint -v --test",
48+
"test-pest": "@php webprint-service test"
4849
},
4950
"minimum-stability": "dev",
5051
"prefer-stable": true,
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22

3-
test('inspiring command', function () {
4-
$this->artisan('inspiring')
5-
->expectsOutput('Simplicity is the ultimate sophistication.')
6-
->assertExitCode(0);
7-
});
3+
//test('inspiring command', function () {
4+
// $this->artisan('inspiring')
5+
// ->expectsOutput('Simplicity is the ultimate sophistication.')
6+
// ->assertExitCode(0);
7+
//});

tests/Unit/ExampleTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?php
22

3-
test('example', function () {
4-
expect(true)->toBeTrue();
5-
});
3+
//test('example', function () {
4+
// expect(true)->toBeTrue();
5+
//});

0 commit comments

Comments
 (0)