-
Notifications
You must be signed in to change notification settings - Fork 3
70 lines (66 loc) · 2 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
name: CI
on:
push:
branches: ["main", "dev"]
pull_request:
branches: ["main", "dev"]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
php-version: ["8.3"]
node-version: [20.x]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Use PHP ${{ matrix.php-version }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/[email protected]
with:
node-version: ${{ matrix.node-version }}
cache: "npm"
- name: Copy .env
run: php -r "file_exists('.env') || copy('.env.example', '.env');"
- name: Install PHP Dependencies
run: composer update --ignore-platform-req=php+ --no-interaction --no-progress
- name: Install Node.js Dependencies
run: |
npm ci
# waits for https://github.com/fsr5-fhaachen/strichlistensystem/issues/99
# - name: Execute Node.js linting
# run: |
# npm run lint
# - name: Execute PHP linting
# run: |
# ./vendor/bin/pint
- name: Execute build
run: npm run build --if-present
- name: Generate key
run: php artisan key:generate
- name: Directory Permissions
run: chmod -R 777 storage bootstrap/cache
- name: Create Database
run: |
mkdir -p database
touch database/database.sqlite
- name: Execute migrations
env:
DB_CONNECTION: sqlite
DB_DATABASE: database/database.sqlite
run: |
php artisan migrate
- name: Execute seeders
env:
DB_CONNECTION: sqlite
DB_DATABASE: database/database.sqlite
run: |
php artisan db:seed
# - name: Execute tests (Unit and Feature tests) via PHPUnit
# env:
# DB_CONNECTION: sqlite
# DB_DATABASE: database/database.sqlite
# run: vendor/bin/phpunit