Skip to content

Commit a5098e4

Browse files
authored
chore: swap makefile for justfile (#371)
# 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 1d19e99 commit a5098e4

File tree

5 files changed

+119
-124
lines changed

5 files changed

+119
-124
lines changed

.github/workflows/ci.yml

Lines changed: 34 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -11,39 +11,42 @@ jobs:
1111
runs-on: ubuntu-latest
1212
strategy:
1313
matrix:
14-
javaversion: ["8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24", "25"]
14+
javaversion:
15+
['8', '9', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23', '24', '25']
1516
steps:
16-
- uses: actions/checkout@v5
17+
- uses: actions/checkout@v6
18+
- uses: extractions/setup-just@v3
1719
- uses: actions/setup-java@v5
1820
with:
19-
distribution: "zulu"
20-
java-version: "25" # Always use the most recent LTS JDK for building
21-
cache: "maven"
21+
distribution: 'zulu'
22+
java-version: '25' # Always use the most recent LTS JDK for building
23+
cache: 'maven'
2224
- name: Install dependencies
23-
run: make install
25+
run: just install
2426
- name: Build Library
25-
run: make build
27+
run: just build
2628
- name: Set up Java ${{ matrix.javaversion }}
2729
uses: actions/setup-java@v5
2830
with:
29-
distribution: "zulu"
31+
distribution: 'zulu'
3032
java-version: ${{ matrix.javaversion }}
31-
cache: "maven"
33+
cache: 'maven'
3234
- name: Run test with Java ${{ matrix.javaversion }}
33-
run: EASYPOST_TEST_API_KEY=123 EASYPOST_PROD_API_KEY=123 make test-ci
35+
run: EASYPOST_TEST_API_KEY=123 EASYPOST_PROD_API_KEY=123 just test-ci
3436
coverage:
3537
runs-on: ubuntu-latest
3638
steps:
37-
- uses: actions/checkout@v5
39+
- uses: actions/checkout@v6
40+
- uses: extractions/setup-just@v3
3841
- uses: actions/setup-java@v5
3942
with:
40-
distribution: "zulu"
41-
java-version: "25" # Always use the most recent LTS JDK for building
42-
cache: "maven"
43+
distribution: 'zulu'
44+
java-version: '25' # Always use the most recent LTS JDK for building
45+
cache: 'maven'
4346
- name: Install dependencies
44-
run: make install
47+
run: just install
4548
- name: Test coverage
46-
run: EASYPOST_TEST_API_KEY=123 EASYPOST_PROD_API_KEY=123 make coverage
49+
run: EASYPOST_TEST_API_KEY=123 EASYPOST_PROD_API_KEY=123 just coverage
4750
- name: Load Rust cache
4851
if: github.ref == 'refs/heads/master'
4952
uses: Swatinem/rust-cache@v2
@@ -58,20 +61,21 @@ jobs:
5861
uses: coverallsapp/github-action@master
5962
with:
6063
github-token: ${{ secrets.GITHUB_TOKEN }}
61-
path-to-lcov: "./coverage.lcov"
64+
path-to-lcov: './coverage.lcov'
6265
lint:
6366
runs-on: ubuntu-latest
6467
steps:
65-
- uses: actions/checkout@v5
68+
- uses: actions/checkout@v6
69+
- uses: extractions/setup-just@v3
6670
- uses: actions/setup-java@v5
6771
with:
68-
distribution: "zulu"
69-
java-version: "25" # Always use the most recent LTS JDK for building
70-
cache: "maven"
72+
distribution: 'zulu'
73+
java-version: '25' # Always use the most recent LTS JDK for building
74+
cache: 'maven'
7175
- name: Install checkstyle and style guide
72-
run: make install-checkstyle
76+
run: just install-checkstyle
7377
- name: Lint
74-
run: make lint
78+
run: just lint
7579
- name: Upload Test results
7680
uses: actions/upload-artifact@master
7781
with:
@@ -81,16 +85,17 @@ jobs:
8185
if: github.ref == 'refs/heads/master'
8286
runs-on: ubuntu-latest
8387
steps:
84-
- uses: actions/checkout@v5
88+
- uses: actions/checkout@v6
89+
- uses: extractions/setup-just@v3
8590
- uses: actions/setup-java@v5
8691
with:
87-
distribution: "zulu"
88-
java-version: "25" # Always use the most recent LTS JDK for building
89-
cache: "maven"
92+
distribution: 'zulu'
93+
java-version: '25' # Always use the most recent LTS JDK for building
94+
cache: 'maven'
9095
- name: Install Dependencies
91-
run: make install
96+
run: just install
9297
- name: Generate Docs
93-
run: make docs
98+
run: just docs
9499
- name: Deploy docs
95100
uses: peaceiris/actions-gh-pages@v3
96101
with:

.github/workflows/publish.yml

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,25 +27,23 @@ jobs:
2727
release:
2828
runs-on: ubuntu-latest
2929
steps:
30-
- name: Checkout repository
31-
uses: actions/checkout@v4
30+
- uses: actions/checkout@v6
3231
with:
3332
fetch-depth: 0
34-
35-
- name: Install JDK
36-
uses: actions/setup-java@v4
33+
- uses: extractions/setup-just@v3
34+
- uses: actions/setup-java@v5
3735
with:
38-
distribution: "zulu"
39-
java-version: "25" # Always use the most recent LTS JDK for building
40-
server-id: "ossrh"
36+
distribution: 'zulu'
37+
java-version: '25' # Always use the most recent LTS JDK for building
38+
server-id: 'ossrh'
4139
# define environmental variable names
4240
server-username: MAVEN_USERNAME
4341
server-password: MAVEN_CENTRAL_TOKEN
4442
gpg-passphrase: MAVEN_GPG_PASSPHRASE
4543
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
4644

4745
- name: Clean, build and publish to Apache Maven Central
48-
run: make install-styleguide publish pass=${{ secrets.MAVEN_GPG_PASSPHRASE }}
46+
run: just install-styleguide publish pass=${{ secrets.MAVEN_GPG_PASSPHRASE }}
4947
env:
5048
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
5149
MAVEN_CENTRAL_TOKEN: ${{ secrets.MAVEN_CENTRAL_TOKEN }}
@@ -54,5 +52,5 @@ jobs:
5452
- name: Upload output files to release
5553
uses: AButler/upload-release-assets@v3.0.1
5654
with:
57-
files: "target/*.jar;target/*.pom;target/*.asc"
55+
files: 'target/*.jar;target/*.pom;target/*.asc'
5856
repo-token: ${{ secrets.GITHUB_TOKEN }}

Makefile

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

README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ Users can subscribe to HTTP requests and responses via the `RequestHook` and `Re
119119

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

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

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

@@ -135,26 +135,26 @@ For additional support, see our [org-wide support policy](https://github.com/Eas
135135

136136
```bash
137137
# Install dependencies
138-
make install
138+
just install
139139

140140
# Build project
141-
make build
141+
just build
142142

143143
# Lint project
144-
make lint
144+
just lint
145145

146146
# Run tests
147-
EASYPOST_TEST_API_KEY=123... EASYPOST_PROD_API_KEY=123... make build test
148-
EASYPOST_TEST_API_KEY=123... EASYPOST_PROD_API_KEY=123... make coverage
147+
EASYPOST_TEST_API_KEY=123... EASYPOST_PROD_API_KEY=123... just build test
148+
EASYPOST_TEST_API_KEY=123... EASYPOST_PROD_API_KEY=123... just coverage
149149

150150
# Run security analysis
151-
make scan
151+
just scan
152152

153153
# Generate library documentation
154-
make docs
154+
just docs
155155

156156
# Update submodules
157-
make update-examples-submodule
157+
just update-examples-submodule
158158
```
159159

160160
### Testing

justfile

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
## Builds the project for development
2+
build:
3+
mvn install -DskipTests=true -Dgpg.skip=true -Dcheckstyle.skip=true -Ddependency-check.skip=true -Djavadoc.skip=true -Djacoco.skip=true
4+
5+
## Cleans the project
6+
clean:
7+
mvn clean
8+
9+
## Test (and build) the project to generate a coverage report
10+
coverage:
11+
mvn test -Dgpg.skip=true -Dcheckstyle.skip=true -Ddependency-check.skip=true -Djavadoc.skip=true jacoco:report
12+
13+
## Check if project follows CheckStyle rules (must run install-checkstyle first)
14+
checkstyle:
15+
java -jar checkstyle.jar src -c examples/style_guides/java/easypost_java_style.xml -d
16+
17+
## Generates library documentation
18+
docs:
19+
mvn install -DskipTests=true -Dgpg.skip=true -Dcheckstyle.skip=true -Ddependency-check.skip=true -Djacoco.skip=true
20+
cp -R target/reports/apidocs/ ./docs/
21+
22+
## Install the Checkstyle tool (Unix only)
23+
install-checkstyle: install-styleguide
24+
curl -LJs https://github.com/checkstyle/checkstyle/releases/download/checkstyle-10.3.1/checkstyle-10.3.1-all.jar -o checkstyle.jar
25+
26+
## Install style guides
27+
install-styleguide: init-examples-submodule
28+
sh examples/symlink_directory_files.sh examples/style_guides/java .
29+
30+
## Initialize the examples submodule
31+
init-examples-submodule:
32+
git submodule init
33+
git submodule update
34+
35+
## Install requirements
36+
install: install-checkstyle
37+
38+
## Lints the project
39+
lint: checkstyle
40+
41+
## Publish a release of the project (will build the project via the `mvn deploy` command)
42+
# pass= - The GPG password to sign the release
43+
publish pass:
44+
mvn clean deploy -Dgpg.passphrase={{pass}}
45+
46+
## Build the project as a dry run to publishing (will build the project via the `mvn install` command)
47+
# pass= - The GPG password to sign the release
48+
publish-dry pass:
49+
mvn clean install -Dgpg.passphrase={{pass}}
50+
51+
## Cuts a release for the project on GitHub (requires GitHub CLI)
52+
# tag = The associated tag title of the release
53+
# target = Target branch or full commit SHA
54+
release tag target:
55+
gh release create {{tag}} target/*.jar target/*.asc target/*.pom --target {{target}}
56+
57+
## Test the project
58+
test:
59+
mvn test -Dgpg.skip=true -Dcheckstyle.skip=true -Ddependency-check.skip=true -Djavadoc.skip=true -Djacoco.skip=true
60+
61+
## Test the project on CI (does not rebuild the project)
62+
test-ci:
63+
mvn surefire:test
64+
65+
## Update the examples submodule
66+
update-examples-submodule:
67+
git submodule init
68+
git submodule update --remote

0 commit comments

Comments
 (0)