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
23 changes: 13 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,17 @@ jobs:
matrix:
rubyversion: ['2.7', '3.0', '3.1', '3.2', '3.3', '3.4', '4.0']
steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v6
- uses: extractions/setup-just@v3
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.rubyversion }}
rubygems: '3.4.0'
bundler-cache: true
- name: Install Dependencies
run: make install
run: just install
- name: run tests
run: EASYPOST_TEST_API_KEY=123 EASYPOST_PROD_API_KEY=123 make test
run: EASYPOST_TEST_API_KEY=123 EASYPOST_PROD_API_KEY=123 just test
- name: Coveralls
if: github.ref == 'refs/heads/master'
uses: coverallsapp/github-action@master
Expand All @@ -32,32 +33,34 @@ jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v6
- uses: extractions/setup-just@v3
- uses: ruby/setup-ruby@v1
with:
ruby-version: '3.4'
rubygems: '3.3.0'
bundler-cache: true
- name: Install Dependencies
run: make install
run: just install
- name: Install style guides
run: make install-styleguide
run: just install-styleguide
- name: Lint Project
run: make lint
run: just lint
docs:
if: github.ref == 'refs/heads/master'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v6
- uses: extractions/setup-just@v3
- uses: ruby/setup-ruby@v1
with:
ruby-version: '3.4'
rubygems: '3.3.0'
bundler-cache: true
- 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@v3
with:
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v6
- uses: extractions/setup-just@v3
- uses: ruby/setup-ruby@v1
with:
ruby-version: '3.4'
Expand Down
75 changes: 0 additions & 75 deletions Makefile

This file was deleted.

18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ If you're using a custom HTTP connection, keep in mind that the `response_data`

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

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.
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.

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

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

```bash
# Install dependencies
make install
just install

# Install style guide (Unix only)
make install-style
just install-style

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

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

# Run security analysis
make scan
just scan

# Generate library documentation
make docs
just docs

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

### Testing
Expand Down
70 changes: 70 additions & 0 deletions justfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# Builds the project
build:
gem build easypost.gemspec --strict
mkdir -p dist
mv *.gem dist/

# Cleans the project
clean:
rm -rf coverage doc *.gem dist

# Generate a test coverage report
coverage:
just test

# Generate documentation for the library
docs:
bundle exec rdoc lib -o docs --title "EasyPost Ruby Docs"

# Import the style guides (Unix only)
install-styleguide: init-examples-submodule
sh examples/symlink_directory_files.sh examples/style_guides/ruby .

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

# Install globally from source
install: init-examples-submodule
bundle install

# Lint the project
lint: rubocop scan

# Fix Rubocop errors
lint-fix: rubocop-fix

# Publishes the built gem to Rubygems
publish:
gem push dist/*.gem

# 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}} dist/* --target {{target}}

# Lints the project with rubocop
rubocop:
bundle exec rubocop

# Fix rubocop errors
rubocop-fix:
bundle exec rubocop -a

# Runs security analysis on the project with Brakeman
scan:
bundle exec brakeman lib --force

# Test the project (and ignore warnings for test output)
test:
bundle exec rspec

# Updates dependencies
update: update-examples-submodule

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