Skip to content

Commit a3c1dbe

Browse files
committed
Create hifolksgh_actions_yaml_generator-20211021-205930.yml
1 parent a6315c4 commit a3c1dbe

File tree

1 file changed

+105
-0
lines changed

1 file changed

+105
-0
lines changed
Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
name: hifolks/gh-actions-yaml-generator
2+
on:
3+
push:
4+
branches:
5+
- main
6+
- develop
7+
- features/**
8+
9+
jobs:
10+
laravel-tests:
11+
runs-on: ubuntu-latest
12+
# Service container Mysql mysql
13+
services:
14+
# Label used to access the service container
15+
mysql:
16+
# Docker Hub image (also with version)
17+
image: mysql:5.7
18+
env:
19+
MYSQL_ALLOW_EMPTY_PASSWORD: yes
20+
MYSQL_DATABASE: db_test_laravel
21+
## map the "external" 33306 port with the "internal" 3306
22+
ports:
23+
- 33306:3306
24+
# Set health checks to wait until mysql database has started (it takes some seconds to start)
25+
options: >-
26+
--health-cmd="mysqladmin ping"
27+
--health-interval=10s
28+
--health-timeout=5s
29+
--health-retries=3
30+
31+
strategy:
32+
matrix:
33+
operating-system: [ubuntu-latest]
34+
php-versions: [ '7.4','8.0' ]
35+
dependency-stability: [ 'prefer-none' ]
36+
37+
name: P${{ matrix.php-versions }} - L${{ matrix.laravel }} - ${{ matrix.dependency-stability }} - ${{ matrix.operating-system}}
38+
39+
steps:
40+
- uses: actions/checkout@v2
41+
- name: Setup Node.js
42+
uses: actions/setup-node@v1
43+
with:
44+
node-version: '16.x'
45+
- name: Install NPM packages
46+
run: npm ci
47+
- name: Build frontend
48+
run: npm run development
49+
- name: Install PHP versions
50+
uses: shivammathur/setup-php@v2
51+
with:
52+
php-version: ${{ matrix.php-versions }}
53+
- name: Copy .env
54+
run: php -r "file_exists('.env') || copy('.env.example', '.env');"
55+
- name: Install Dependencies
56+
if: steps.vendor-cache.outputs.cache-hit != 'true'
57+
run: composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist
58+
59+
- name: Update Dependencies with latest stable
60+
if: matrix.dependency-stability == 'prefer-stable'
61+
run: composer update --prefer-stable
62+
- name: Update Dependencies with lowest stable
63+
if: matrix.dependency-stability == 'prefer-lowest'
64+
run: composer update --prefer-stable --prefer-lowest
65+
66+
- name: Generate key
67+
run: php artisan key:generate
68+
- name: Directory Permissions
69+
run: chmod -R 777 storage bootstrap/cache
70+
- name: Run Migrations
71+
# Set environment
72+
env:
73+
DB_CONNECTION: mysql
74+
DB_DATABASE: db_test_laravel
75+
DB_PORT: 33306
76+
DB_USER: root
77+
78+
run: php artisan migrate
79+
80+
- name: Show dir
81+
run: pwd
82+
- name: PHP Version
83+
run: php --version
84+
85+
# Code quality
86+
- name: Execute tests (Unit and Feature tests) via PHPUnit
87+
# Set environment
88+
env:
89+
DB_CONNECTION: mysql
90+
DB_DATABASE: db_test_laravel
91+
DB_PORT: 33306
92+
DB_USER: root
93+
94+
run: vendor/bin/phpunit --testdox
95+
96+
97+
- name: Execute Code Sniffer via phpcs
98+
run: |
99+
vendor/bin/phpcs --standard=PSR12 app
100+
101+
- name: Execute Code Static Analysis (PHP Stan + Larastan)
102+
run: |
103+
vendor/bin/phpstan analyse -c ./phpstan.neon --no-progress
104+
105+

0 commit comments

Comments
 (0)