Skip to content

Commit 950774f

Browse files
authored
Merge pull request #19 from igorsgm/develop
Github Workflow
2 parents 20801ed + 1fd8fb5 commit 950774f

File tree

3 files changed

+126
-8
lines changed

3 files changed

+126
-8
lines changed

.gitattributes

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,10 @@
1-
* text=auto
1+
# Path-based git attributes
2+
# https://www.kernel.org/pub/software/scm/git/docs/gitattributes.html
3+
4+
# Ignore all test and documentation with "export-ignore".
5+
/.gitattributes export-ignore
6+
/.gitignore export-ignore
7+
/.travis.yml export-ignore
8+
/phpunit.xml.dist export-ignore
9+
/tests export-ignore
10+
/.editorconfig export-ignore

.github/workflows/main.yml

Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
# GithHub Actions Workflow generated with Ghygen
2+
# Original configuration: https://ghygen.hi-folks.dev?code=0555902844da5dd5163a69e93327a0aa
3+
name: Laravel Git Hooks
4+
on:
5+
push:
6+
branches:
7+
- master
8+
- main
9+
- develop
10+
pull_request:
11+
branches:
12+
- master
13+
- main
14+
- develop
15+
16+
jobs:
17+
laravel-tests:
18+
runs-on: ubuntu-latest
19+
20+
strategy:
21+
matrix:
22+
operating-system: [ ubuntu-latest ]
23+
php: [ '8.1', '8.2' ]
24+
dependency-stability: [ 'prefer-stable','prefer-lowest' ]
25+
26+
laravel: [ '10.*' ]
27+
include:
28+
- laravel: 10.*
29+
testbench: 8.*
30+
31+
name: PHP ${{ matrix.php }} - Laravel ${{ matrix.laravel }} - ${{ matrix.dependency-stability }} - ${{ matrix.operating-system}}
32+
33+
steps:
34+
- name: Checkout code
35+
uses: actions/checkout@v3
36+
37+
- name: Setup Node.js
38+
uses: actions/setup-node@v3
39+
with:
40+
node-version: '18.x'
41+
42+
- name: Cache node_modules directory
43+
uses: actions/cache@v3
44+
id: node_modules-cache
45+
with:
46+
path: node_modules
47+
key: ${{ runner.OS }}-build-${{ hashFiles('**/package.json') }}-${{ hashFiles('**/package-lock.json') }}
48+
49+
- name: Install NPM packages
50+
if: steps.node_modules-cache.outputs.cache-hit != 'true'
51+
run: npm ci --include=dev
52+
53+
- name: Install PHP versions
54+
uses: shivammathur/setup-php@v2
55+
with:
56+
php-version: ${{ matrix.php }}
57+
58+
- name: Get Composer Cache Directory
59+
id: composer-cache
60+
run: |
61+
echo "::set-output name=dir::$(composer config cache-files-dir)"
62+
63+
- name: Cache Composer dependencies
64+
uses: actions/cache@v3
65+
id: actions-cache
66+
with:
67+
path: ${{ steps.composer-cache.outputs.dir }}
68+
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
69+
restore-keys: |
70+
${{ runner.os }}-composer-
71+
72+
- name: Cache PHP dependencies (vendor)
73+
uses: actions/cache@v3
74+
id: vendor-cache
75+
with:
76+
path: vendor
77+
key: ${{ runner.OS }}-build-${{ hashFiles('**/composer.lock') }}
78+
79+
- name: Install Laravel Dependencies
80+
if: steps.vendor-cache.outputs.cache-hit != 'true'
81+
run: |
82+
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update
83+
composer update --${{ matrix.dependency-stability }} --prefer-dist --no-interaction --no-suggest
84+
85+
- name: Update Dependencies with latest stable
86+
if: matrix.dependency-stability == 'prefer-stable'
87+
run: composer update --prefer-stable
88+
89+
- name: Update Dependencies with lowest stable
90+
if: matrix.dependency-stability == 'prefer-lowest'
91+
run: composer update --prefer-stable --prefer-lowest
92+
93+
- name: Set up Git User
94+
run: |
95+
git config --global user.email "github-actions@example.com"
96+
git config --global user.name "GitHub Actions"
97+
98+
# Code quality
99+
- name: Execute tests (Unit and Feature tests) via PestPHP
100+
shell: 'script -q -e -c "bash {0}"'
101+
# Set environment
102+
env:
103+
SESSION_DRIVER: array
104+
TTY: true
105+
106+
run: vendor/bin/pest
107+
108+
- name: Execute Code Sniffer via Laravel Pint
109+
run: vendor/bin/pint --test src config

composer.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@
2121
}
2222
],
2323
"require": {
24-
"php": "^7.2|^8.0",
25-
"illuminate/config": "^6.0|^7.0|^8.0|^9.0|^10.0",
26-
"illuminate/console": "^6.0|^7.0|^8.0|^9.0|^10.0",
27-
"illuminate/container": "^6.0|^7.0|^8.0|^9.0|^10.0",
28-
"illuminate/contracts": "^6.0|^7.0|^8.0|^9.0|^10.0",
29-
"illuminate/pipeline": "^6.0|^7.0|^8.0|^9.0|^10.0",
30-
"illuminate/support": "^6.0|^7.0|^8.0|^9.0|^10.0"
24+
"php": "^8.1",
25+
"illuminate/config": "^9.0|^10.0",
26+
"illuminate/console": "^9.0|^10.0",
27+
"illuminate/container": "^9.0|^10.0",
28+
"illuminate/contracts": "^9.0|^10.0",
29+
"illuminate/pipeline": "^9.0|^10.0",
30+
"illuminate/support": "^9.0|^10.0"
3131
},
3232
"require-dev": {
3333
"enlightn/enlightn": "^2.3",

0 commit comments

Comments
 (0)