mirror of
https://github.com/ivuorinen/ivuorinen.git
synced 2026-03-18 15:02:51 +00:00
* chore(deps): pin dependencies Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * fix(ci): labels.yaml indentation --------- Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Ismo Vuorinen <ismo@ivuorinen.net>
61 lines
1.8 KiB
YAML
61 lines
1.8 KiB
YAML
---
|
|
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
|
|
name: Laravel Setup and Composer test
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
pull_request:
|
|
branches: [main]
|
|
workflow_call:
|
|
|
|
jobs:
|
|
laravel-tests:
|
|
runs-on: ubuntu-latest
|
|
|
|
permissions:
|
|
contents: write
|
|
statuses: write
|
|
|
|
steps:
|
|
- uses: shivammathur/setup-php@9e72090525849c5e82e596468b86eb55e9cc5401 # v2
|
|
with:
|
|
php-version: '8.4'
|
|
|
|
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
|
|
|
|
- name: 'Check file existence'
|
|
id: check_files
|
|
uses: andstor/file-existence-action@076e0072799f4942c8bc574a82233e1e4d13e9d6 # v3
|
|
with:
|
|
files: 'package.json, artisan'
|
|
|
|
- name: Copy .env
|
|
if: steps.check_files.outputs.files_exists == 'true'
|
|
run: php -r "file_exists('.env') || copy('.env.example', '.env');"
|
|
|
|
- name: Install Dependencies
|
|
if: steps.check_files.outputs.files_exists == 'true'
|
|
run: composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist
|
|
|
|
- name: Generate key
|
|
if: steps.check_files.outputs.files_exists == 'true'
|
|
run: php artisan key:generate
|
|
|
|
- name: Directory Permissions
|
|
if: steps.check_files.outputs.files_exists == 'true'
|
|
run: chmod -R 777 storage bootstrap/cache
|
|
|
|
- name: Create Database
|
|
if: steps.check_files.outputs.files_exists == 'true'
|
|
run: |
|
|
mkdir -p database
|
|
touch database/database.sqlite
|
|
|
|
- name: Execute composer test (Unit and Feature tests)
|
|
if: steps.check_files.outputs.files_exists == 'true'
|
|
env:
|
|
DB_CONNECTION: sqlite
|
|
DB_DATABASE: database/database.sqlite
|
|
run: composer test
|