Skip to content

Commit e48a4ce

Browse files
committed
Create test.yml
1 parent 52b6d83 commit e48a4ce

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed

.github/workflows/test.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Test
2+
3+
on: [pull_request]
4+
5+
jobs:
6+
test:
7+
name: Lint & Test
8+
runs-on: ubuntu-latest
9+
10+
steps:
11+
- uses: actions/checkout@v4
12+
13+
- name: Setup PHP and Composer
14+
uses: shivammathur/setup-php@v2
15+
with:
16+
php-version: 8.2
17+
tools: composer:v2
18+
coverage: none
19+
20+
- name: Get Cache Directory
21+
id: composer-cache-dir
22+
run: echo dir=$(composer config cache-files-dir) >> $GITHUB_OUTPUT
23+
24+
- name: Cache Dependencies
25+
uses: actions/cache@v4
26+
with:
27+
key: composer-cache-${{ hashFiles('**/composer.lock') }}
28+
path: ${{ steps.composer-cache-dir.outputs.dir }}
29+
restore-keys: composer-cache-
30+
31+
- name: Install Dependencies
32+
run: composer install -q --no-interaction
33+
34+
- name: Configure Application
35+
run: |
36+
cp .env.testing .env
37+
php artisan key:generate
38+
39+
- name: Run Linter
40+
run: composer lint
41+
42+
- name: Run Tests
43+
run: composer test

0 commit comments

Comments
 (0)