Skip to content

Commit 6b5ae8b

Browse files
authored
chore: swap makefile for justfile (#376)
# Description <!-- Please provide a general summary of your PR changes and link any related issues or other pull requests. --> # Testing <!-- Please provide details on how you tested this code. See below. - All pull requests must be tested (unit tests where possible with accompanying cassettes, or provide a screenshot of end-to-end testing when unit tests are not possible) - New features must get a new unit test - Bug fixes/refactors must re-record existing cassettes --> # Pull Request Type Please select the option(s) that are relevant to this PR. - [ ] Bug fix (non-breaking change which fixes an issue) - [ ] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) - [ ] Improvement (fixing a typo, updating readme, renaming a variable name, etc)
1 parent 0784e2f commit 6b5ae8b

4 files changed

Lines changed: 81 additions & 84 deletions

File tree

.github/workflows/ci.yml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,20 +11,22 @@ jobs:
1111
runs-on: ubuntu-latest
1212
steps:
1313
- uses: actions/checkout@v6
14+
- uses: extractions/setup-just@v3
1415
- uses: shivammathur/setup-php@v2
1516
with:
1617
php-version: '8.5'
1718
- name: install dependencies
18-
run: make install
19+
run: just install
1920
- name: lint
20-
run: make lint
21+
run: just lint
2122
run-tests:
2223
runs-on: ubuntu-latest
2324
strategy:
2425
matrix:
2526
phpversion: ['8.1', '8.2', '8.3', '8.4', '8.5']
2627
steps:
2728
- uses: actions/checkout@v6
29+
- uses: extractions/setup-just@v3
2830
- uses: shivammathur/setup-php@v2
2931
with:
3032
php-version: ${{ matrix.phpversion }}
@@ -39,9 +41,9 @@ jobs:
3941
key: ${{ runner.os }}-${{ matrix.phpversion }}-composer-${{ hashFiles('**/composer.lock') }}
4042
restore-keys: ${{ runner.os }}-${{ matrix.phpversion }}-composer-
4143
- name: install dependencies
42-
run: make install
44+
run: just install
4345
- name: test with phpunit on ${{ matrix.phpversion }}
44-
run: EASYPOST_TEST_API_KEY=123 EASYPOST_PROD_API_KEY=123 make coverage
46+
run: EASYPOST_TEST_API_KEY=123 EASYPOST_PROD_API_KEY=123 just coverage
4547
- name: Coveralls
4648
if: github.ref == 'refs/heads/master'
4749
env:
@@ -52,13 +54,14 @@ jobs:
5254
runs-on: ubuntu-latest
5355
steps:
5456
- uses: actions/checkout@v6
57+
- uses: extractions/setup-just@v3
5558
- uses: shivammathur/setup-php@v2
5659
with:
5760
php-version: '8.5'
5861
- name: Install Dependencies
59-
run: make install
62+
run: just install
6063
- name: Generate Docs
61-
run: make docs
64+
run: just docs
6265
- name: Deploy Docs
6366
uses: peaceiris/actions-gh-pages@v4
6467
with:

Makefile

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

README.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ You can also unsubscribe your functions in a similar manner by using the `unsubs
8888

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

91-
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.
91+
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.
9292

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

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

103103
```bash
104104
# Install dependencies
105-
make install
105+
just install
106106

107107
# Update dependencies
108-
make update
108+
just update
109109

110110
# Lint project
111-
make lint
112-
make lint-fix
111+
just lint
112+
just lint-fix
113113

114114
# Run tests
115-
EASYPOST_TEST_API_KEY=123... EASYPOST_PROD_API_KEY=123... make test
115+
EASYPOST_TEST_API_KEY=123... EASYPOST_PROD_API_KEY=123... just test
116116

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

121121
# Run security analysis
122-
make scan
122+
just scan
123123

124124
# Generate library documentation (requires phpDocumentor.phar in the root of the project)
125-
make docs
125+
just docs
126126

127127
# Update submodules
128-
make update-examples-submodule
128+
just update-examples-submodule
129129
```
130130

131131
### Testing

justfile

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# Cleans the project
2+
clean:
3+
rm -rf vendor clover.xml clover.html bin .phpunit.cache
4+
5+
# Run linting on the PHP files
6+
codesniffer:
7+
composer lint
8+
9+
# Fix lint errors on PHP files
10+
codesniffer-fix:
11+
composer fix
12+
13+
# Runs the test suite and generates a coverage report
14+
coverage:
15+
composer coverage
16+
17+
# Generate documentation for the library
18+
docs:
19+
curl -LJs https://github.com/phpDocumentor/phpDocumentor/releases/download/v3.3.1/phpDocumentor.phar -o phpDocumentor.phar
20+
php phpDocumentor.phar -d lib -t docs
21+
22+
# Initialize the examples submodule
23+
init-examples-submodule:
24+
git submodule init
25+
git submodule update
26+
27+
# Install dependencies
28+
install: init-examples-submodule
29+
composer install --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist
30+
31+
# Lint the project
32+
lint: codesniffer phpstan scan
33+
34+
# Fix linting errors
35+
lint-fix: codesniffer-fix
36+
37+
# Scan for static analysis errors
38+
phpstan:
39+
composer phpstan
40+
41+
# Cuts a release for the project on GitHub (requires GitHub CLI)
42+
# tag = The associated tag title of the release
43+
# target = Target branch or full commit SHA
44+
release tag target:
45+
gh release create {{tag}} --target {{target}}
46+
47+
# Runs security analysis on the project
48+
scan:
49+
composer scan
50+
51+
# Test the project
52+
test:
53+
composer test
54+
55+
# Update dependencies
56+
update: update-examples-submodule
57+
composer update
58+
59+
# Update the examples submodule
60+
update-examples-submodule:
61+
git submodule init
62+
git submodule update --remote

0 commit comments

Comments
 (0)