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
15 changes: 9 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,22 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: extractions/setup-just@v3
- uses: shivammathur/setup-php@v2
with:
php-version: '8.5'
- name: install dependencies
run: make install
run: just install
- name: lint
run: make lint
run: just lint
run-tests:
runs-on: ubuntu-latest
strategy:
matrix:
phpversion: ['8.1', '8.2', '8.3', '8.4', '8.5']
steps:
- uses: actions/checkout@v6
- uses: extractions/setup-just@v3
- uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.phpversion }}
Expand All @@ -39,9 +41,9 @@ jobs:
key: ${{ runner.os }}-${{ matrix.phpversion }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-${{ matrix.phpversion }}-composer-
- name: install dependencies
run: make install
run: just install
- name: test with phpunit on ${{ matrix.phpversion }}
run: EASYPOST_TEST_API_KEY=123 EASYPOST_PROD_API_KEY=123 make coverage
run: EASYPOST_TEST_API_KEY=123 EASYPOST_PROD_API_KEY=123 just coverage
- name: Coveralls
if: github.ref == 'refs/heads/master'
env:
Expand All @@ -52,13 +54,14 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: extractions/setup-just@v3
- uses: shivammathur/setup-php@v2
with:
php-version: '8.5'
- name: Install Dependencies
run: make install
run: just install
- name: Generate Docs
run: make docs
run: just docs
- name: Deploy Docs
uses: peaceiris/actions-gh-pages@v4
with:
Expand Down
68 changes: 0 additions & 68 deletions Makefile

This file was deleted.

20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ You can also unsubscribe your functions in a similar manner by using the `unsubs

API documentation can be found at: <https://docs.easypost.com>.

Library documentation can be found on the web at: <https://easypost.github.io/easypost-php/> or by building them locally via the `make docs` command.
Library documentation can be found on the web at: <https://easypost.github.io/easypost-php/> or by building them locally via the `just docs` command.

Upgrading major versions of this project? Refer to the [Upgrade Guide](UPGRADE_GUIDE.md).

Expand All @@ -102,30 +102,30 @@ For additional support, see our [org-wide support policy](https://github.com/Eas

```bash
# Install dependencies
make install
just install

# Update dependencies
make update
just update

# Lint project
make lint
make lint-fix
just lint
just lint-fix

# Run tests
EASYPOST_TEST_API_KEY=123... EASYPOST_PROD_API_KEY=123... make test
EASYPOST_TEST_API_KEY=123... EASYPOST_PROD_API_KEY=123... just test

# Generate coverage reports (requires Xdebug for HTML report)
# NOTE: When using PHP 8.2, you must use 8.2.9+ to avoid segfaults when generating coverage
EASYPOST_TEST_API_KEY=123... EASYPOST_PROD_API_KEY=123... make coverage
EASYPOST_TEST_API_KEY=123... EASYPOST_PROD_API_KEY=123... just coverage

# Run security analysis
make scan
just scan

# Generate library documentation (requires phpDocumentor.phar in the root of the project)
make docs
just docs

# Update submodules
make update-examples-submodule
just update-examples-submodule
```

### Testing
Expand Down
62 changes: 62 additions & 0 deletions justfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# Cleans the project
clean:
rm -rf vendor clover.xml clover.html bin .phpunit.cache

# Run linting on the PHP files
codesniffer:
composer lint

# Fix lint errors on PHP files
codesniffer-fix:
composer fix

# Runs the test suite and generates a coverage report
coverage:
composer coverage

# Generate documentation for the library
docs:
curl -LJs https://github.com/phpDocumentor/phpDocumentor/releases/download/v3.3.1/phpDocumentor.phar -o phpDocumentor.phar
php phpDocumentor.phar -d lib -t docs

# Initialize the examples submodule
init-examples-submodule:
git submodule init
git submodule update

# Install dependencies
install: init-examples-submodule
composer install --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist

# Lint the project
lint: codesniffer phpstan scan

# Fix linting errors
lint-fix: codesniffer-fix

# Scan for static analysis errors
phpstan:
composer phpstan

# Cuts a release for the project on GitHub (requires GitHub CLI)
# tag = The associated tag title of the release
# target = Target branch or full commit SHA
release tag target:
gh release create {{tag}} --target {{target}}

# Runs security analysis on the project
scan:
composer scan

# Test the project
test:
composer test

# Update dependencies
update: update-examples-submodule
composer update

# Update the examples submodule
update-examples-submodule:
git submodule init
git submodule update --remote
Loading