generated from wayofdev/laravel-starter-tpl
-
-
Notifications
You must be signed in to change notification settings - Fork 0
96 lines (79 loc) · 2.52 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
---
on: # yamllint disable-line rule:truthy
pull_request:
branches:
- master
- develop
name: 🔍 Continuous integration
defaults:
run:
working-directory: app
jobs:
integration:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
os: ["ubuntu-22.04"]
php: ["8.1", "8.2"]
steps:
- name: 📦 Check out the codebase
uses: actions/checkout@v4
- name: 🛠️ Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: dom, curl, libxml, mbstring, zip, fileinfo, xdebug
ini-values: error_reporting=E_ALL
tools: composer:v2
coverage: xdebug
- name: 🛠️ Setup problem matchers
run: |
echo "::add-matcher::${{ runner.tool_cache }}/php.json"
echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
- name: ♻️ Restore cached backend dependencies
id: cached-composer-dependencies
uses: actions/cache@v4
with:
path: vendor
key: vendor-${{ runner.os }}-${{ hashFiles('**/composer.lock') }}-${{ matrix.php }}
- name: 📥 Install backend dependencies
if: steps.cached-composer-dependencies.outputs.cache-hit != 'true'
run: composer install
- name: 🛠️ Prepare environment
run: |
cd ../ && make env && cd app
cp ../.env .env
mkdir -p ./.build/php-cs-fixer
mkdir -p ./.build/phpstan
mkdir -p ./.build/phpunit
env:
APP_NAME: laravel
SHARED_SERVICES_NAMESPACE: ss
PROJECT_SERVICES_NAMESPACE: wod
COMPOSE_PROJECT_NAME: laravel-cycle-starter-tpl
- name: 🔑 Generate secret application key
run: php artisan key:generate
- name: 🔗 Create laravel storage symlinks
run: php artisan storage:link
- name: 🔍 Run coding standards task
run: |
composer run cs:diff
- name: 🔍 Run static analysis using phpstan
run: |
composer run stan
env:
PHPSTAN_OUTPUT_FORMAT: github
- name: 🧪 Execute phpunit and pest tests
run: |
composer run test:cc
env:
XDEBUG_MODE: "coverage"
- name: 📤 Upload coverage results to Codecov.io
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true
verbose: true
files: coverage.xml
...