Skip to content

Commit

Permalink
💚 Add run-tests github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
rxcod9 committed Jul 6, 2021
1 parent 20d9df5 commit 6eb3439
Show file tree
Hide file tree
Showing 2 changed files with 94 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# These are supported funding model platforms

github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
patreon: ramakant
open_collective: # Replace with a single Open Collective username
ko_fi: # Replace with a single Ko-fi username
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
82 changes: 82 additions & 0 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
name: tests

on:
push:
branches:
- 'main'
pull_request:
types:
- synchronize
- opened
- edited
- reopened

jobs:
test:
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
php: [7.4, 8.0]
laravel: ['~8.0']

name: 'PHP ${{ matrix.php }} / ${{ matrix.laravel }}'

steps:
- uses: actions/checkout@master

# Configure PHP
- name: Select PHP version
uses: shivammathur/setup-php@master
with:
php-version: '${{ matrix.php }}'
extensions: mbstring, pdo_sqlite, fileinfo, gd
coverage: none

# Configure NPM
- uses: actions/setup-node@v2
with:
node-version: '14.x'

# Install PHP dependencies
- name: Install Composer dependencies
run: composer require "illuminate/support:${{ matrix.laravel }}"

# Install legacy factories for Laravel 8
- name: Install legacy factories for Laravel
if: ${{ matrix.laravel == '8.*' }}
run: composer require laravel/legacy-factories

# Display installed laravel version
- name: Show laravel version
run: composer show laravel/framework

# Install NPM dependencies
- name: Install Dependencies
run: npm install

# Build static assets
- name: Compile Assets
run: npm run prod
- name: Copy .env
run: php -r "file_exists('.env') || copy('.env.example', '.env');"
- name: Install Dependencies
run: composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist
- name: Generate key
run: php artisan key:generate
- name: Directory Permissions
run: chmod -R 777 storage bootstrap/cache
- name: Create Database
run: |
mkdir -p database
touch database/database.sqlite
- name: Execute tests (Unit and Feature tests) via PHPUnit
env:
DB_CONNECTION: sqlite
DB_DATABASE: database/database.sqlite
run: vendor/bin/phpunit

# # Run phpunit tests
# - name: Run tests
# run: ./vendor/bin/phpunit

0 comments on commit 6eb3439

Please sign in to comment.