fix: course seeder not run in production (resolves #2013) #4025
Workflow file for this run
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
name: Run front-end tests | |
on: | |
push: | |
branches: [dev, staging, production] | |
pull_request: | |
branches: [dev, staging, production] | |
jobs: | |
frontend-tests: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
php: [8.1] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: technote-space/get-diff-action@v6 | |
id: git-diff | |
with: | |
patterns: | | |
composer.json | |
composer.lock | |
**/*.php | |
package.json | |
package-lock.json | |
**/*.css | |
**/*.js" | |
- uses: shivammathur/setup-php@v2 | |
if: steps.git-diff.outputs.diff | |
with: | |
php-version: ${{ matrix.php }} | |
coverage: none | |
- name: Cache Composer packages | |
if: steps.git-diff.outputs.diff | |
uses: actions/cache@v3 | |
with: | |
path: vendor | |
key: php-${{ hashFiles('**/composer.lock') }} | |
- name: Install Dependencies | |
if: steps.git-diff.outputs.diff | |
run: composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist | |
- uses: actions/setup-node@v4 | |
if: steps.git-diff.outputs.diff | |
with: | |
node-version-file: ".nvmrc" | |
- name: Cache node modules | |
if: steps.git-diff.outputs.diff | |
uses: actions/cache@v3 | |
with: | |
path: node_modules | |
key: ${{ runner.OS }}-build-${{ hashFiles('**/package-lock.json') }} | |
- name: Install dependencies | |
if: steps.git-diff.outputs.diff | |
run: npm install | |
env: | |
CI: true | |
- name: Create test database | |
if: steps.git-diff.outputs.diff | |
run: | | |
sudo systemctl start mysql.service | |
mysqladmin create accessibilityexchange --user="root" --password="root" | |
- name: Copy .env | |
if: steps.git-diff.outputs.diff | |
run: php -r "file_exists('.env') || copy('.env.example', '.env');" | |
- name: Generate keys | |
if: steps.git-diff.outputs.diff | |
run: | | |
echo "CIPHERSWEET_KEY=\"$(openssl rand -hex 32)\"" >> .env | |
php artisan key:generate | |
- name: Upgrade Chrome Driver | |
if: steps.git-diff.outputs.diff | |
run: php artisan dusk:chrome-driver `/opt/google/chrome/chrome --version | cut -d " " -f3 | cut -d "." -f1` | |
- name: Start Chrome Driver | |
if: steps.git-diff.outputs.diff | |
run: ./vendor/laravel/dusk/bin/chromedriver-linux & | |
- name: Run Laravel Server | |
if: steps.git-diff.outputs.diff | |
run: | | |
php artisan migrate | |
php artisan storage:link | |
php artisan serve & | |
env: | |
DB_PASSWORD: root | |
DB_HOST: localhost | |
- name: Run Dusk Tests | |
if: steps.git-diff.outputs.diff | |
env: | |
APP_URL: "http://127.0.0.1:8000" | |
run: php artisan pest:dusk | |
- name: Upload Screenshots | |
if: failure() | |
uses: actions/upload-artifact@v3 | |
with: | |
name: screenshots | |
path: tests/Browser/screenshots | |
- name: Upload Console Logs | |
if: failure() | |
uses: actions/upload-artifact@v3 | |
with: | |
name: console | |
path: tests/Browser/console |