Skip to content

Commit

Permalink
add github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
imanghafoori1 committed Dec 12, 2023
1 parent b4daeaf commit 3433ca7
Show file tree
Hide file tree
Showing 3 changed files with 101 additions and 2 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/imports.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Check Imports

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

permissions:
contents: read

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Validate composer.json and composer.lock
run: composer validate --strict

- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v3
with:
path: vendor
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-
- name: Install dependencies
run: composer install --prefer-dist --no-progress

- name: Check Imports
run: composer run-script imports
63 changes: 63 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: tests

# Controls when the workflow will run
on:
push:
branches: [master]
pull_request:
branches: [master]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
test:
# The type of runner that the job will run on
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
php: [7.2, 7.3, 7.4, 8.0, 8.1, 8.2, 8.3]
laravel: [^6.0, ^7.0, ^8.0, ^9.0, ^10.0]
exclude:
- php: 7.2
laravel: ^8.0
- php: 7.2
laravel: ^9.0
- php: 7.2
laravel: ^10.0
- php: 7.3
laravel: ^9.0
- php: 7.3
laravel: ^10.0
- php: 7.4
laravel: ^9.0
- php: 7.4
laravel: ^10.0
- php: 8.0
laravel: ^10.0
- php: 8.1
laravel: ^6.0
- php: 8.1
laravel: ^7.0

name: PHP ${{ matrix.php }} - Laravel ${{ matrix.laravel }}

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: mbstring, exif, iconv, tokenizer
coverage: none

- name: Install dependencies
run: |
composer require "laravel/framework=${{ matrix.laravel }}" --no-update
composer update --prefer-dist --no-interaction --no-progress
- name: Execute tests
run: vendor/bin/phpunit --verbose
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
"require-dev": {
"orchestra/testbench": "~3.0|~4.0|~5.0|~6.0|~7.0|~8.0",
"imanghafoori/php-imports-analyzer": "1.0.*",
"barryvdh/laravel-debugbar": "v3.9.2",
"mockery/mockery": "^1.5.0"
"barryvdh/laravel-debugbar": ">=v1.0.0",
"mockery/mockery": ">=0.9"
},
"autoload": {
"psr-4": {
Expand Down

0 comments on commit 3433ca7

Please sign in to comment.