Skip to content
Merged
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
34 changes: 34 additions & 0 deletions .github/workflows/assets.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Build Assets

on:
push:
branches:
- main
paths:
- 'resources/**'
- 'dist/**'

jobs:
build-dist:
runs-on: ubuntu-latest

permissions:
contents: write

steps:
- uses: actions/checkout@v5
- uses: shivammathur/setup-php@v2
with:
php-version: 8.4
tools: composer:v2
coverage: none
- uses: actions/setup-node@v5
with:
node-version: '24'
- run: composer install --no-interaction --prefer-dist --optimize-autoloader
- run: npm install
- run: npm run prod
- uses: stefanzweifel/git-auto-commit-action@v7
with:
commit_message: "[skip ci] Build assets"
file_pattern: 'dist/*'
53 changes: 28 additions & 25 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
push:
pull_request:
schedule:
- cron: '0 14 * * 3'
- cron: '0 11 * * 6'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand All @@ -18,48 +18,48 @@ jobs:
name: ESLint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5

- name: Setup Node
uses: actions/setup-node@v4
uses: actions/setup-node@v5
with:
node-version: '24'

- name: Get yarn cache directory
id: yarn-cache
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
- name: Get npm cache directory
id: npm-cache
run: echo "dir=$(npm config get cache)" >> $GITHUB_OUTPUT

- name: Cache yarn dependencies
uses: actions/cache@v4
- name: Cache npm dependencies
uses: actions/cache@v5
with:
path: ${{ steps.yarn-cache.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}
restore-keys: ${{ runner.os }}-yarn-
path: ${{ steps.npm-cache.outputs.dir }}
key: ${{ runner.os }}-node-${{ hashFiles('package.json') }}
restore-keys: ${{ runner.os }}-node-

- name: Install dependencies
run: yarn install
run: npm install

- name: Run ESLint
run: yarn lint
run: npm run lint

lint-php:
name: PHP Code Standards
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.3'
php-version: '8.4'
tools: composer:v2

- 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
uses: actions/cache@v5
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('composer.json') }}
Expand All @@ -72,16 +72,19 @@ jobs:
run: composer phpcs

test:
name: Tests (PHP ${{ matrix.php }} - Statamic ${{ matrix.statamic }})
name: ${{ matrix.name }}
runs-on: ubuntu-latest
needs: [lint-js, lint-php]
strategy:
fail-fast: false
matrix:
php: ['8.3', '8.4']
statamic: ['5', '6']
include:
- { name: 'Statamic 5 / Laravel 11 / PHP 8.3 / lowest', php: '8.3', statamic: '5', laravel: '11.*', dependency-version: 'prefer-lowest' }
- { name: 'Statamic 5 / Laravel 12 / PHP 8.4 / stable', php: '8.4', statamic: '5', laravel: '12.*', dependency-version: 'prefer-stable' }
- { name: 'Statamic 6 / Laravel 12 / PHP 8.4 / lowest', php: '8.4', statamic: '6', laravel: '12.*', dependency-version: 'prefer-lowest' }
- { name: 'Statamic 6 / Laravel 13 / PHP 8.5 / stable', php: '8.5', statamic: '6', laravel: '13.*', dependency-version: 'prefer-stable' }
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5

- name: Setup PHP
uses: shivammathur/setup-php@v2
Expand All @@ -96,16 +99,16 @@ jobs:
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT

- name: Cache Composer dependencies
uses: actions/cache@v4
uses: actions/cache@v5
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-php-${{ matrix.php }}-statamic-${{ matrix.statamic }}-composer-${{ hashFiles('composer.json') }}
restore-keys: ${{ runner.os }}-php-${{ matrix.php }}-statamic-${{ matrix.statamic }}-composer-
key: ${{ runner.os }}-php-${{ matrix.php }}-statamic-${{ matrix.statamic }}-laravel-${{ matrix.laravel }}-${{ matrix.dependency-version }}-composer-${{ hashFiles('composer.json') }}
restore-keys: ${{ runner.os }}-php-${{ matrix.php }}-statamic-${{ matrix.statamic }}-laravel-${{ matrix.laravel }}-${{ matrix.dependency-version }}-composer-

- name: Install dependencies
run: |
composer require statamic/cms:^${{ matrix.statamic }}.0 --no-interaction --no-update
composer update --no-interaction --prefer-dist
composer require "statamic/cms:^${{ matrix.statamic }}.0" "illuminate/contracts:${{ matrix.laravel }}" --no-interaction --no-update
composer update --no-interaction --${{ matrix.dependency-version }} --prefer-dist

- name: Run tests
run: vendor/bin/pest
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
"mck89/peast": "^1.17"
},
"require-dev": {
"orchestra/testbench": "^10.9",
"pestphp/pest": "^4.3",
"orchestra/testbench": "^9.0 || ^10.0 || ^11.0",
"pestphp/pest": "^3.0 || ^4.0",
"laravel/pint": "^1.27"
},
"autoload": {
Expand Down
Loading