generated from Sikessem/skeleton
-
Notifications
You must be signed in to change notification settings - Fork 0
135 lines (109 loc) · 3.72 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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
name: CI
permissions:
contents: read
on: ['push', 'pull_request']
jobs:
build:
runs-on: ${{ matrix.os }}
continue-on-error: ${{ matrix.experimental }}
strategy:
fail-fast: true
matrix:
os: [ubuntu-latest]
bun: [1.0]
experimental: [false]
name: 🍱 Build assets using Bun-${{ matrix.bun }} on ${{ matrix.os }}
steps:
- name: 🚚 Get latest code
uses: actions/checkout@v4
- name: 🎉 Setup Bun
uses: oven-sh/setup-bun@v1
with:
bun-version: ${{ matrix.bun }}
- name: ✨ Install JavaScript dependencies
run: bun install
- name: ✅ Check code style
run: bun check
- name: 🧪 Test components
run: bun run test
- name: 📦️ Compile assets
run: bun run build
- name: 🚚 Upload distribution files
uses: actions/upload-artifact@v3
with:
name: dist-files
path: public/static
serve:
needs: build
runs-on: ${{ matrix.os }}
continue-on-error: ${{ matrix.experimental }}
strategy:
fail-fast: true
matrix:
os: [ubuntu-latest]
php: [8.1, 8.2]
dependencies: [lowest, highest]
experimental: [false]
name: 🌍 Serve with PHP-${{ matrix.php }} ${{ matrix.dependencies }} on ${{ matrix.os }}
steps:
- name: 🚚 Get latest code
uses: actions/checkout@v4
- name: 📂 Cache dependencies
id: composer-cache
run: |
echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-dependencies-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }}
restore-keys: |
${{ runner.os }}-dependencies-php-${{ matrix.php }}-composer-
- name: 🎉 Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: curl, dom, gd, intl, mbstring, openssl, pdo, pdo_mysql, tokenizer, zip
ini-values: error_reporting=E_ALL
tools: composer:v2, php-cs-fixer, phpunit, vimeo/psalm
coverage: pcov
- name: ✨ Install PHP dependencies
run: |
composer install -q --no-ansi --no-cache --no-interaction --no-scripts --no-progress --prefer-dist
composer update --${{ matrix.dependency-version }} --no-interaction --prefer-dist
- name: 🔧 Configure environment
run: |
cp .env.example .env.ci
set -e
sed -i "s|^\(APP_ENV=\s*\).*$|\1ci|" .env.ci
printf "The complete `.env.ci` ... \n\n"
cat .env.ci
- name: 🔒️ Generate Key
run: |
set -e
php artisan key:generate --env=ci
php artisan queue:restart --env=ci
- name: 🔐 Directory Permissions
run: |
chmod -R 777 storage bootstrap/cache
chmod -R 777 storage/
- name: 🧹 Clear Caches
run: set -e && php artisan optimize:clear --env=ci
- name: ✅ Check code lint
run: composer check
- name: ⚗️ Run static analysis
run: composer analyse
- name: ⚡️ Optimize Stuffs
run: set -e && php artisan optimize --env=ci
- name: 🚚 Download distribution files
uses: actions/download-artifact@v3
with:
name: dist-files
path: public/static
- name: 📂 List public/
run: ls public/static
- name: 🧪 Test features
run: |
set -e && php artisan serve --env=ci > /dev/null 2>&1 &
composer test
- name: 💚 Test the whole application
run: composer debug