Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev/explore #27

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/laravel-pint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
push:
branches:
- main
- integration

jobs:
laravel-pint:
Expand Down
301 changes: 301 additions & 0 deletions .github/workflows/laravel.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,301 @@
name: Laravel

on:
push:
branches:
- rolloff/integration
- main
- devops/CI
- devops/*
- shift-*
- integration
pull_request:
branches:
- main
- devops/*
repository_dispatch:
types: [submodule_update]

jobs:
laravel-tests:

runs-on: ubuntu-latest
strategy:
# fail-fast: true
matrix:
# php: [8.3, 8.4]
php: [8.3]
# stability: [lowest, highest]

env:
DB_CONNECTION: mysql
DB_HOST: localhost
DB_PORT: 3306
DB_DATABASE: testdb
DB_USERNAME: root
DB_PASSWORD: root
SESSION_DRIVER: file
AWS_ACCESS_KEY_ID: ${{ secrets.CI_AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.CI_AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: us-east-1
AWS_BUCKET: worqc-2-assets
APP_URL: http://localhost
DO_TESTS: 0
# DO_TESTS: 0
defaults:
run:
shell: bash
steps:
- name: Report starting time
run: date
- run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event."
- run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by GitHub!"
- run: echo "🔎 The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}."

##### testing vars
- if: ${{ env.super_secret != '' }}
run: echo 'This step will only run if the secret has a value set.'
- if: ${{ env.super_secret == '' }}
run: echo 'This step will only run if the secret does not have a value set.'



# - uses: actions/checkout@v4
#
# - run: cp .env.bak .env
# - run: cat .env | sort
# continue-on-error: true
#
# - name: cat .env.localci | sort
# run: cat .env.localci | sort

# - name: cat /var/run/act/workflow/envs.txt | sort
# run: cat /var/run/act/workflow/envs.txt | sort


# - name: Put vars in GH environment
# run: sed -s -e '/^#.*$/d' -e '/^$/d' .env.localci >>"$GITHUB_ENV"


#Test Host bridging
# - run: curl host.docker.internal:9517
#

## - run: sed -s -e '/^#.*$/d' -e '/^$/d' .env.localci >>"$GITHUB_ENV"
## - run: sed -s -e '/^#.*$/d' -e '/^$/d' .env.bak >>"$GITHUB_ENV"
#

# - name: env | sort
# run: env | sort



- name: Set up MySQL
if: ${{ ! github.event.act }} #& ${{ env.DO_TESTS != '' }}
run: |
sudo systemctl start mysql
mysql -e 'CREATE DATABASE testdb;' -uroot -proot
mysql -e 'SHOW DATABASES;' -uroot -proot
# - name: Create Database
# run: |
# mkdir -p database
# touch database/database.sqlite

- name: Setup PHP
# - uses: shivammathur/setup-php@15c43e89cdef867065b0213be354c2841860869e
uses: shivammathur/setup-php@v2
if: ${{ ! github.event.act }}
with:
# php-version: '8.2'
# tools: composer
# extensions: gd,redis
php-version: ${{ matrix.php }}
- uses: actions/checkout@v4
with:
# ref: devops/CI # should be actual "pushed" branch, no?
# ref: devops/CI
token: ${{ secrets.GH_PAT }} # `GH_PAT` is a secret that contains your PAT
submodules: 'true'
- name: Directory Permissions
run: chmod -R 777 storage bootstrap/cache

- name: Add HTTP basic auth credentials
run: echo '${{ secrets.LBU_COMPOSER_AUTH_JSON }}' > $GITHUB_WORKSPACE/auth.json

- name: Copy .env
run: php -r "file_exists('.env') || copy('.env.example', '.env');"

- name: "📦 Composer Install Dependencies"
uses: ramsey/composer-install@v2
env:
COMPOSER_AUTH: '{"http-basic": { ${{ secrets.COMPOSER_HTTP_BASIC }} }, "github-oauth": {"github.com": "${{ secrets.GH_PAT }}"}}'
with:
composer-options: "--no-scripts --no-ansi --no-interaction --no-progress --prefer-dist -o --ignore-platform-reqs"

- name: "📦📦 Cache Node Dependencies"
uses: actions/setup-node@v4

- name: Generate key
run: php artisan key:generate

- name: Publish views
run: |
php artisan vendor:publish --provider="Processoft\ContainerForm\app\Providers\ContainerFormServiceProvider" --tag="public" --force
php artisan vendor:publish --provider="Processoft\BackpackCustomViews\BackpackCustomViewsServiceProvider" --tag="views" --force
php artisan vendor:publish --provider="Processoft\Rolloff\RolloffBaseServiceProvider" --tag="public-rolloff" --force
php artisan vendor:publish --provider="Backpack\CRUD\BackpackServiceProvider" --tag="public" --force

- name: Migrate and seed
if: ${{ env.DO_TESTS != '' }}
# run: php artisan migrate:fresh --seed --seeder=RolloffDemoDataSeeder
run: php artisan migrate:fresh --seed

- name: Generate Airdrop Hash
run: echo "AIRDROP_HASH=$(php artisan airdrop:hash)" >> $GITHUB_ENV
- name: Cache Airdrop Assets
uses: actions/cache@v4
with:
key: ${{ runner.os }}-airdrop-${{ env.AIRDROP_HASH }}
path: /tmp/airdrop-*

- name: Build or download assets as required
run: bash -x build.sh

# - name: Download assets
# run: |
# php artisan -vvv airdrop:hash
# php artisan airdrop:debug
# php artisan -vvv airdrop:download
# - name: "📦 Cache Node Dependencies"
# uses: actions/setup-node@v4
# # - run: npm ci
# - name: install npm
# run: npm install
# - name: Build assets
# run: npm run build

# META INFO
- name: Report pest version
run: ./vendor/bin/pest --version
- name: Artisan about
run: php artisan about
# - name: PHP INFO
# run: php -i

# Unit/BrowserKit (non-dusk) Tests
- name: Execute minimal tests (one class)
if: ${{ env.DO_TESTS != '' }}
# continue-on-error: true
run: ./vendor/bin/pest --testsuite=Unit --exclude-group=res --exclude-group=pdf --exclude-group=dusk --exclude-group=flaky --exclude-group=tempskip --filter=ExampleTest

# Dusk Tests setup
# - name: install dusk
# if: false #${{ env.DO_TESTS != '' }}
# continue-on-error: true
## run: php artisan dusk:install
# run: php artisan dusk:chrome-driver

- name: "Install Laravel Dusk chrome driver"
if: ${{ !github.event.act || (env.DO_TESTS != '') }}
run: php artisan dusk:chrome-driver --detect
continue-on-error: true
## - name: Start Chrome Driver
## run: ./vendor/laravel/dusk/bin/chromedriver-linux &
# - name: Migrate and seed
# run: php artisan migrate:fresh --seed --seeder=RolloffDemoDataSeeder



# - name: launch server laravel
# shell: nohup bash {0} > myoutput.txt >2&1 & disown
# run: |
# php artisan serve --host=localhost --port=8000 --no-interaction &

# Unit/BrowserKit (non-dusk) Tests
# - name: BUGHUNT Execute minimal tests (one class)
# if: ${{ env.DO_TESTS != '' }}
# continue-on-error: true
# run: ./vendor/bin/pest --testsuite=Unit --exclude-group=res --exclude-group=pdf --exclude-group=dusk --exclude-group=flaky --exclude-group=tempskip --filter=CanReduceCrudImagesTraitTest --columns=120

- name: Fix permissions on port 80
if: ${{ env.DO_TESTS != '' }}
run: |
sudo setcap CAP_NET_BIND_SERVICE=+eip /usr/bin/curl
sudo setcap CAP_NET_BIND_SERVICE=+eip /usr/bin/php${{ matrix.php }}
continue-on-error: true

- name: Run Laravel Server
if: ${{ env.DO_TESTS != '' }}
run: php artisan serve --port=80 --no-reload --no-interaction &
continue-on-error: true

# tests "without" servers?
- name: Execute All "regular" tests, no (dusk,res,pdf,flaky)
if: ${{ env.DO_TESTS != '' }}
continue-on-error: true
# continue-on-error: true
# run: ./vendor/bin/pest --testsuite=All --exclude-group=res --exclude-group=dusk --exclude-group=pdf --exclude-group=tempSkip --exclude-group=flaky
run: |
php artisan migrate:fresh --quiet
composer test-parallel
php artisan migrate:fresh --quiet
composer test-non-parallel
php artisan migrate:fresh --quiet

# Dusk Tests - later options:
- name: Execute flaky tests alone (passesonRetry)
if: ${{ env.DO_TESTS != '' }}
run: |
php artisan migrate:fresh --quiet
composer test-flaky
continue-on-error: true

- name: "🔮️ Laravel DuskTest"
if: ${{ env.DO_TESTS != '' }}
run: |
php artisan migrate:fresh --quiet
composer test-dusk

# run: ./vendor/bin/pest --testsuite=All --filter="TestDuskTest"
# continue-on-error: true

# - name: "🔮️ Laravel Dusk PRE Test"
# if: ${{ env.DO_TESTS != '' }}
# run: ./vendor/bin/pest --testsuite=All --filter="TestDuskTest"
## continue-on-error: true
#
# - name: "🔮️ Laravel Dusk small Test"
# if: ${{ env.DO_TESTS != '' }}
# run: ./vendor/bin/pest --testsuite=All --group=dusk --exclude-group=res --exclude-group=pdf --exclude-group=flaky --exclude-group=slow --filter="RoOrderUIDuskTest"
# continue-on-error: false
#
# - name: "🔮️ Laravel Dusk Tests All"
# if: ${{ env.DO_TESTS != '' }}
# run: ./vendor/bin/pest --testsuite=All --group=dusk --exclude-group=res --exclude-group=pdf --exclude-group=flaky --exclude-group=slow
## continue-on-error: true
## - name: "🔮️ Laravel Dusk Tests Roll-off"
## run: ./vendor/bin/pest --testsuite=Roll-off --group=dusk --exclude-group=flaky --exclude-group=slow --retry
## continue-on-error: true


# Report and cleanup
- name: Upload logs on build failure 🪵
uses: actions/upload-artifact@master
if: failure()
with:
name: Laravel Logs
path: ./storage/logs
- name: Upload Screenshots
if: failure()
uses: actions/upload-artifact@master
with:
name: screenshots
path: tests/Browser/screenshots
- name: Upload Console Logs
if: failure()
uses: actions/upload-artifact@master
with:
name: console
path: tests/Browser/console
- name: Report timing
run: date
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
pull_request:
branches:
- main

- integration
jobs:
tests:
runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<a href="https://packagist.org/packages/laravel/framework"><img src="https://img.shields.io/packagist/l/laravel/framework" alt="License"></a>
</p>

## About Laravel
## About MY! Laravel!

Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experience to be truly fulfilling. Laravel takes the pain out of development by easing common tasks used in many web projects, such as:

Expand Down
1 change: 0 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
"ext-redis": "*",
"laravel/framework": "^11.9",
"laravel/jetstream": "^5.1",
"laravel/nova": "4.34.3",
"laravel/sanctum": "^4.0",
"laravel/tinker": "^2.9",
"livewire/livewire": "^3.0"
Expand Down
Loading