chore(deps): update dependency stylelint to v16.20.0 #5934
This file contains hidden or 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 Laravel tests | |
on: | |
push: | |
branches: [dev, staging, production] | |
pull_request: | |
branches: [dev, staging, production] | |
jobs: | |
laravel-tests: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: true | |
matrix: | |
php: [8.4] | |
name: tests - PHP ${{ matrix.php }} | |
outputs: | |
diff: ${{ steps.git-diff.outputs.diff }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: greguintow/get-diff-action@v7 | |
id: git-diff | |
with: | |
PATTERNS: | | |
composer.json | |
composer.lock | |
**/*.php | |
- uses: shivammathur/setup-php@v2 | |
if: steps.git-diff.outputs.diff | |
with: | |
php-version: ${{ matrix.php }} | |
coverage: pcov | |
- name: Get composer cache directory | |
id: composer-cache | |
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT | |
- name: Cache composer dependencies | |
uses: actions/cache@v4 | |
with: | |
path: ${{ steps.composer-cache.outputs.dir }} | |
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} | |
restore-keys: ${{ runner.os }}-composer- | |
- 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" | |
cache: npm | |
- name: Install dependencies | |
if: steps.git-diff.outputs.diff | |
run: npm ci | |
- name: Create test database | |
if: steps.git-diff.outputs.diff | |
run: | | |
sudo systemctl start mysql.service | |
mysqladmin create tae-test --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: Directory Permissions | |
if: steps.git-diff.outputs.diff | |
run: chmod -R 777 storage bootstrap/cache | |
- name: Run tests | |
if: steps.git-diff.outputs.diff && matrix.php != '8.4' | |
env: | |
DB_DATABASE: tae-test | |
DB_PASSWORD: root | |
DB_HOST: localhost | |
run: | | |
php artisan migrate | |
php artisan storage:link | |
php artisan test | |
- name: Run tests with coverage | |
if: steps.git-diff.outputs.diff && matrix.php == '8.4' | |
env: | |
DB_DATABASE: tae-test | |
DB_PASSWORD: root | |
DB_HOST: localhost | |
run: | | |
php artisan migrate | |
php artisan storage:link | |
php artisan test --coverage-clover coverage.xml | |
- name: Save code coverage to artifact | |
uses: actions/upload-artifact@v4 | |
if: steps.git-diff.outputs.diff && matrix.php == '8.4' | |
with: | |
name: code-coverage | |
path: "coverage.xml" | |
retention-days: 5 | |
upload-coverage: | |
runs-on: ubuntu-latest | |
needs: | |
- laravel-tests | |
if: needs.laravel-tests.outputs.diff && github.repository == 'accessibility-exchange/platform' | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Fetch code coverage artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: code-coverage | |
- name: Upload coverage to Codecov | |
uses: codecov/codecov-action@v5 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
fail_ci_if_error: true |