Skip to content

Commit 71c2a0f

Browse files
authored
chore: swap makefile for justfile (#336)
# 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 4569ecf commit 71c2a0f

File tree

5 files changed

+94
-95
lines changed

5 files changed

+94
-95
lines changed

.github/workflows/ci.yml

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,17 @@ jobs:
1313
matrix:
1414
rubyversion: ['2.7', '3.0', '3.1', '3.2', '3.3', '3.4', '4.0']
1515
steps:
16-
- uses: actions/checkout@v5
16+
- uses: actions/checkout@v6
17+
- uses: extractions/setup-just@v3
1718
- uses: ruby/setup-ruby@v1
1819
with:
1920
ruby-version: ${{ matrix.rubyversion }}
2021
rubygems: '3.4.0'
2122
bundler-cache: true
2223
- name: Install Dependencies
23-
run: make install
24+
run: just install
2425
- name: run tests
25-
run: EASYPOST_TEST_API_KEY=123 EASYPOST_PROD_API_KEY=123 make test
26+
run: EASYPOST_TEST_API_KEY=123 EASYPOST_PROD_API_KEY=123 just test
2627
- name: Coveralls
2728
if: github.ref == 'refs/heads/master'
2829
uses: coverallsapp/github-action@master
@@ -32,32 +33,34 @@ jobs:
3233
lint:
3334
runs-on: ubuntu-latest
3435
steps:
35-
- uses: actions/checkout@v5
36+
- uses: actions/checkout@v6
37+
- uses: extractions/setup-just@v3
3638
- uses: ruby/setup-ruby@v1
3739
with:
3840
ruby-version: '3.4'
3941
rubygems: '3.3.0'
4042
bundler-cache: true
4143
- name: Install Dependencies
42-
run: make install
44+
run: just install
4345
- name: Install style guides
44-
run: make install-styleguide
46+
run: just install-styleguide
4547
- name: Lint Project
46-
run: make lint
48+
run: just lint
4749
docs:
4850
if: github.ref == 'refs/heads/master'
4951
runs-on: ubuntu-latest
5052
steps:
51-
- uses: actions/checkout@v5
53+
- uses: actions/checkout@v6
54+
- uses: extractions/setup-just@v3
5255
- uses: ruby/setup-ruby@v1
5356
with:
5457
ruby-version: '3.4'
5558
rubygems: '3.3.0'
5659
bundler-cache: true
5760
- name: Install Dependencies
58-
run: make install
61+
run: just install
5962
- name: Generate Docs
60-
run: make docs
63+
run: just docs
6164
- name: Deploy docs
6265
uses: peaceiris/actions-gh-pages@v3
6366
with:

.github/workflows/release.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ jobs:
99
release:
1010
runs-on: ubuntu-latest
1111
steps:
12-
- uses: actions/checkout@v5
12+
- uses: actions/checkout@v6
13+
- uses: extractions/setup-just@v3
1314
- uses: ruby/setup-ruby@v1
1415
with:
1516
ruby-version: '3.4'

Makefile

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

README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ If you're using a custom HTTP connection, keep in mind that the `response_data`
165165

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

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

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

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

180180
```bash
181181
# Install dependencies
182-
make install
182+
just install
183183

184184
# Install style guide (Unix only)
185-
make install-style
185+
just install-style
186186

187187
# Lint project
188-
make lint
189-
make lint-fix
188+
just lint
189+
just lint-fix
190190

191191
# Run tests (coverage is generated on a successful test suite run)
192-
EASYPOST_TEST_API_KEY=123... EASYPOST_PROD_API_KEY=123... make test
192+
EASYPOST_TEST_API_KEY=123... EASYPOST_PROD_API_KEY=123... just test
193193

194194
# Run security analysis
195-
make scan
195+
just scan
196196

197197
# Generate library documentation
198-
make docs
198+
just docs
199199

200200
# Update submodules
201-
make update-examples-submodule
201+
just update-examples-submodule
202202
```
203203

204204
### Testing

justfile

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
# Builds the project
2+
build:
3+
gem build easypost.gemspec --strict
4+
mkdir -p dist
5+
mv *.gem dist/
6+
7+
# Cleans the project
8+
clean:
9+
rm -rf coverage doc *.gem dist
10+
11+
# Generate a test coverage report
12+
coverage:
13+
just test
14+
15+
# Generate documentation for the library
16+
docs:
17+
bundle exec rdoc lib -o docs --title "EasyPost Ruby Docs"
18+
19+
# Import the style guides (Unix only)
20+
install-styleguide: init-examples-submodule
21+
sh examples/symlink_directory_files.sh examples/style_guides/ruby .
22+
23+
# Initialize the examples submodule
24+
init-examples-submodule:
25+
git submodule init
26+
git submodule update
27+
28+
# Install globally from source
29+
install: init-examples-submodule
30+
bundle install
31+
32+
# Lint the project
33+
lint: rubocop scan
34+
35+
# Fix Rubocop errors
36+
lint-fix: rubocop-fix
37+
38+
# Publishes the built gem to Rubygems
39+
publish:
40+
gem push dist/*.gem
41+
42+
# Cuts a release for the project on GitHub (requires GitHub CLI)
43+
# tag = The associated tag title of the release
44+
# target = Target branch or full commit SHA
45+
release tag target:
46+
gh release create {{tag}} dist/* --target {{target}}
47+
48+
# Lints the project with rubocop
49+
rubocop:
50+
bundle exec rubocop
51+
52+
# Fix rubocop errors
53+
rubocop-fix:
54+
bundle exec rubocop -a
55+
56+
# Runs security analysis on the project with Brakeman
57+
scan:
58+
bundle exec brakeman lib --force
59+
60+
# Test the project (and ignore warnings for test output)
61+
test:
62+
bundle exec rspec
63+
64+
# Updates dependencies
65+
update: update-examples-submodule
66+
67+
# Update the examples submodule
68+
update-examples-submodule:
69+
git submodule init
70+
git submodule update --remote

0 commit comments

Comments
 (0)