Skip to content

Commit 2e1152a

Browse files
Merge pull request #21 from aarondfrancis/update
Update CI and tooling to current best practices
2 parents 32ec1d5 + 0028f18 commit 2e1152a

File tree

7 files changed

+61
-43
lines changed

7 files changed

+61
-43
lines changed

.github/workflows/style.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,15 @@ jobs:
1818
- name: Setup PHP
1919
uses: shivammathur/setup-php@v2
2020
with:
21-
php-version: "8.3"
21+
php-version: "8.4"
2222
extensions: json, dom, curl, libxml, mbstring
2323
coverage: none
2424

25-
- name: Install Pint
26-
run: composer global require laravel/pint
25+
- name: Install dependencies
26+
run: composer install --no-interaction --prefer-dist
2727

2828
- name: Run Pint
29-
run: pint
29+
run: vendor/bin/pint
3030

3131
- name: Commit linted files
3232
uses: stefanzweifel/git-auto-commit-action@v5

.github/workflows/tests.yml

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
strategy:
1818
fail-fast: false
1919
matrix:
20-
php: [ 8.1, 8.2, 8.3 ]
20+
php: [ 8.1, 8.2, 8.3, 8.4 ]
2121
laravel: [ '10.*', '11.*', '12.*' ]
2222
dependency-version: [ prefer-lowest, prefer-stable ]
2323

@@ -29,19 +29,6 @@ jobs:
2929

3030
name: P${{ matrix.php }} / L${{ matrix.laravel }} / ${{ matrix.dependency-version }}
3131

32-
services:
33-
mysql:
34-
image: mysql:8.0
35-
env:
36-
MYSQL_DATABASE: fast_paginate
37-
MYSQL_HOST: 127.0.0.1
38-
MYSQL_USER: test
39-
MYSQL_PASSWORD: root
40-
MYSQL_ROOT_PASSWORD: root
41-
ports:
42-
- 3306:3306
43-
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
44-
4532
steps:
4633
- name: Checkout code
4734
uses: actions/checkout@v4

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,4 @@ bootstrap/cache/services.php
1111
docs/*.blade.php
1212
docs/**/*.blade.php
1313
.phpunit.cache/test-results
14+
.claude/

CLAUDE.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# CLAUDE.md
2+
3+
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
4+
5+
## Project Overview
6+
7+
Airdrop is a Laravel package that speeds up deployments by skipping asset compilation when possible. It calculates a hash of build inputs (packages, JS/CSS files, ENV vars, etc.) and reuses previously built assets if the configuration hasn't changed.
8+
9+
Full docs: https://hammerstone.dev/airdrop/docs
10+
11+
## Commands
12+
13+
```bash
14+
# Run tests
15+
vendor/bin/phpunit
16+
17+
# Run a single test
18+
vendor/bin/phpunit --filter test_name
19+
20+
# Code formatting
21+
vendor/bin/pint
22+
23+
# Check formatting without changes
24+
vendor/bin/pint --test
25+
```
26+
27+
## Architecture
28+
29+
**Drivers** (`src/Drivers/`) - Handle storage/retrieval of built assets:
30+
- `BaseDriver` - Abstract base with `download()` and `upload()` methods
31+
- `FilesystemDriver` - Uses Laravel's filesystem (local, S3, etc.)
32+
- `GithubActionsDriver` - Uses GitHub Actions cache
33+
34+
**Triggers** (`src/Triggers/`) - Determine what affects the build hash:
35+
- Implement `TriggerContract::triggerBuildWhenChanged($config)`
36+
- `FileTrigger` - Hashes file contents
37+
- `ConfigTrigger` - Hashes config values
38+
39+
**Commands** (`src/Commands/`):
40+
- `airdrop:download` - Pull cached assets if hash matches
41+
- `airdrop:upload` - Store built assets with current hash
42+
- `airdrop:hash` - Output current hash
43+
- `airdrop:debug` - Debug trigger outputs
44+
- `airdrop:install` - Publish config file
45+
46+
## Code Style
47+
48+
Uses Laravel Pint with the Laravel preset. Key customizations in `pint.json`:
49+
- `concat_space`: one space around concatenation operator
50+
- `trailing_comma_in_multiline`: false

composer.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,10 @@
1616
"illuminate/console": "^10.0|^11.0|^12.0"
1717
},
1818
"require-dev": {
19-
"orchestra/testbench": "^8.0|^9.0|^10.0",
20-
"mockery/mockery": "^1.3.3",
21-
"phpunit/phpunit": "^8.4|^9.5|^10.5|^11.5.3"
19+
"laravel/pint": "^1.0",
20+
"mockery/mockery": "^1.6",
21+
"orchestra/testbench": "^8.21|^9.2|^10.0",
22+
"phpunit/phpunit": "^10.5|^11.0"
2223
},
2324
"autoload": {
2425
"psr-4": {

phpunit.xml.dist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" bootstrap="vendor/autoload.php" backupGlobals="false" colors="true" processIsolation="false" stopOnFailure="false" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd" cacheDirectory=".phpunit.cache" backupStaticProperties="false">
33
<testsuites>
4-
<testsuite name="TBD Test Suite">
4+
<testsuite name="Airdrop Test Suite">
55
<directory>tests</directory>
66
<exclude>tests/BaseTest.php</exclude>
77
</testsuite>

test

Lines changed: 0 additions & 21 deletions
This file was deleted.

0 commit comments

Comments
 (0)