Skip to content

Commit f44ffb9

Browse files
Create laravel.yml
1 parent ef20c35 commit f44ffb9

File tree

1 file changed

+81
-0
lines changed

1 file changed

+81
-0
lines changed

.github/workflows/laravel.yml

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
name: Tests
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
11+
jobs:
12+
ci:
13+
runs-on: ubuntu-latest
14+
strategy:
15+
fail-fast: true
16+
matrix:
17+
php: [8.4]
18+
19+
name: Tests
20+
21+
steps:
22+
- name: Checkout
23+
uses: actions/checkout@v4
24+
25+
- name: Cache Dependencies PHP
26+
id: php-cache
27+
uses: actions/cache@v4
28+
with:
29+
path: vendor
30+
key: dependencies-php-composer-${{ hashFiles('composer.lock') }}
31+
32+
- name: Setup PHP
33+
uses: shivammathur/setup-php@v2
34+
with:
35+
php-version: ${{ matrix.php }}
36+
extensions: json, dom, curl, libxml, mbstring, zip
37+
tools: composer:v2
38+
coverage: xdebug
39+
40+
- name: Set up Node & NPM
41+
uses: actions/setup-node@v2
42+
with:
43+
node-version: "22.x"
44+
45+
- name: Setup Problem Matches
46+
run: |
47+
echo "::add-matcher::${{ runner.tool_cache }}/php.json"
48+
echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
49+
50+
- name: Install PHP dependencies
51+
if: steps.php-cache.outputs.cache-hit != 'true'
52+
run: composer install --no-interaction --no-progress --ansi
53+
54+
- name: Get NPM cache directory
55+
id: npm-cache-dir
56+
shell: bash
57+
run: echo "dir=$(npm config get cache)" >> ${GITHUB_OUTPUT}
58+
59+
- name: Cache dependencies
60+
id: npm-cache
61+
uses: actions/cache@v4
62+
with:
63+
path: ${{ steps.npm-cache-dir.outputs.dir }}
64+
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
65+
restore-keys: |
66+
${{ runner.os }}-node-
67+
68+
- name: Install dependencies
69+
if: steps.cache.outputs.cache-hit != 'true'
70+
run: npm install
71+
72+
- name: Build dependencies
73+
run: npm run build
74+
75+
- name: Prepare Laravel
76+
run: |
77+
cp .env.example .env
78+
php artisan key:generate
79+
80+
- name: Tests
81+
run: composer test

0 commit comments

Comments
 (0)