Skip to content

Commit ff5f02f

Browse files
authored
Merge pull request #31 from FitzwilliamMuseum/issue25
Update action
2 parents a76363b + caecb9c commit ff5f02f

File tree

1 file changed

+24
-20
lines changed

1 file changed

+24
-20
lines changed

.github/workflows/laravel.yml

Lines changed: 24 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Laravel
1+
name: PHP Composer
22

33
on:
44
push:
@@ -7,26 +7,30 @@ on:
77
branches: [ main ]
88

99
jobs:
10-
laravel-tests:
10+
build:
1111

1212
runs-on: ubuntu-latest
1313

1414
steps:
15-
- uses: shivammathur/setup-php@15c43e89cdef867065b0213be354c2841860869e
16-
with:
17-
php-version: '8.0'
18-
- uses: actions/checkout@v2
19-
- name: Copy .env
20-
run: php -r "file_exists('.env') || copy('.env.example', '.env');"
21-
- name: Install Dependencies
22-
run: composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist
23-
- name: Install NPM Dependencies
24-
run: npm install
25-
- name: Generate key
26-
run: php artisan key:generate
27-
- name: Generate dev npm app.js
28-
run: npm run dev
29-
- name: Directory Permissions
30-
run: chmod -R 777 storage bootstrap/cache
31-
- name: Execute tests (Unit and Feature tests) via PHPUnit
32-
run: vendor/bin/phpunit
15+
- uses: actions/checkout@v2
16+
17+
- name: Validate composer.json and composer.lock
18+
run: composer validate --strict
19+
20+
- name: Cache Composer packages
21+
id: composer-cache
22+
uses: actions/cache@v2
23+
with:
24+
path: vendor
25+
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
26+
restore-keys: |
27+
${{ runner.os }}-php-
28+
29+
- name: Install dependencies
30+
run: composer install --prefer-dist --no-progress --no-suggest
31+
32+
# Add a test script to composer.json, for instance: "test": "vendor/bin/phpunit"
33+
# Docs: https://getcomposer.org/doc/articles/scripts.md
34+
35+
# - name: Run test suite
36+
# run: composer run-script test

0 commit comments

Comments
 (0)