forked from canyongbs/advisingapp
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Kevin Ullyott <[email protected]>
- Loading branch information
Showing
8 changed files
with
426 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
name: 'Setup composer dependencies' | ||
description: 'Sets up composer dependencies for the workflow' | ||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Get composer cache directory | ||
id: composer-cache | ||
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT | ||
shell: bash | ||
|
||
- name: Cache dependencies | ||
uses: actions/cache@v3 | ||
with: | ||
path: ${{ steps.composer-cache.outputs.dir }} | ||
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} | ||
restore-keys: ${{ runner.os }}-composer- | ||
|
||
- name: Install Dependencies | ||
run: composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist | ||
shell: bash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,129 @@ | ||
name: CI | ||
|
||
on: | ||
workflow_call: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build-deps: | ||
runs-on: ubuntu-22.04 | ||
|
||
steps: | ||
- uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: "8.2" | ||
|
||
- uses: actions/checkout@v3 | ||
|
||
- name: Setup Dependencies | ||
uses: ./.github/actions/composer-dependency-setup | ||
test: | ||
runs-on: ubuntu-22.04 | ||
|
||
timeout-minutes: 10 | ||
|
||
needs: [build-deps] | ||
|
||
env: | ||
DB_PORT: 3306 | ||
DB_HOST: 127.0.0.1 | ||
DB_USERNAME: root | ||
DB_PASSWORD: root | ||
DB_DATABASE: testing | ||
SCOUT_PREFIX: test_ | ||
MEILISEARCH_KEY: testing | ||
MEILISEARCH_HOST: http://127.0.0.1:7700 | ||
MEILISEARCH_PORT: 7700 | ||
|
||
services: | ||
mysql: | ||
image: mysql:5.7 | ||
env: | ||
MYSQL_ROOT_PASSWORD: ${{ env.DB_PASSWORD }} | ||
MYSQL_DATABASE: ${{ env.DB_DATABASE }} | ||
ports: | ||
- 3306/tcp | ||
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 | ||
|
||
redis: | ||
image: redis | ||
ports: | ||
- 6379:6379 | ||
options: --health-cmd="redis-cli ping" --health-interval=10s --health-timeout=5s --health-retries=3 | ||
|
||
meilisearch: | ||
image: "getmeili/meilisearch:v1.2.0" | ||
ports: | ||
- 7700:7700 | ||
options: --health-cmd "wget --no-verbose --spider http://127.0.0.1:7700/health" --health-timeout 5s --health-retries 3 | ||
|
||
steps: | ||
- uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: "8.2" | ||
|
||
- uses: actions/checkout@v3 | ||
|
||
- name: Start Mysql | ||
run: sudo service mysql start | ||
|
||
- name: Create Database | ||
run: mysql -uroot -proot -e "CREATE DATABASE IF NOT EXISTS testing" | ||
|
||
- name: Copy .env | ||
run: php -r "file_exists('.env') || copy('.env.example', '.env');" | ||
|
||
- name: Setup Dependencies | ||
uses: ./.github/actions/composer-dependency-setup | ||
|
||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version-file: '.nvmrc' | ||
cache: 'npm' | ||
- run: npm install | ||
|
||
- name: Build Assets | ||
run: npm run build | ||
|
||
- name: Generate key | ||
run: php artisan key:generate | ||
|
||
- name: Clear Config | ||
run: php artisan optimize:clear | ||
|
||
- name: Directory Permissions | ||
run: chmod -R 777 storage bootstrap/cache | ||
|
||
- name: Check route integrity | ||
run: php artisan route:list | ||
|
||
- name: Execute tests (Unit and Feature tests) via PHPUnit | ||
run: php artisan test --parallel --configuration phpunit-ci.xml --testsuite=Feature,Unit | ||
lint: | ||
runs-on: ubuntu-22.04 | ||
|
||
timeout-minutes: 10 | ||
|
||
needs: [build-deps] | ||
|
||
steps: | ||
- uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: "8.2" | ||
|
||
- uses: actions/checkout@v3 | ||
|
||
- name: Setup Dependencies | ||
uses: ./.github/actions/composer-dependency-setup | ||
|
||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version-file: '.nvmrc' | ||
cache: 'npm' | ||
- run: npm install | ||
|
||
- name: Build Assets | ||
run: npm run build | ||
|
||
- name: PHP CS Fixer | ||
run: ./vendor/friendsofphp/php-cs-fixer/php-cs-fixer fix --dry-run -v --using-cache=no --stop-on-violation --config=./php-cs-fixer.php |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
name: Pull Requests | ||
|
||
on: | ||
pull_request: | ||
|
||
jobs: | ||
code-checks: | ||
name: Code Checks | ||
|
||
uses: ./.github/workflows/ci.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.