diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9038cd4e..be6150b4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 @@ -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: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c86264ad..24bc1393 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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' diff --git a/Makefile b/Makefile deleted file mode 100644 index a315b82d..00000000 --- a/Makefile +++ /dev/null @@ -1,75 +0,0 @@ -## help - Display help about make targets for this Makefile -help: - @cat Makefile | grep '^## ' --color=never | cut -c4- | sed -e "`printf 's/ - /\t- /;'`" | column -s "`printf '\t'`" -t - -## build - Builds the project -build: - gem build easypost.gemspec --strict - mkdir -p dist - mv *.gem dist/ - -## clean - Cleans the project -clean: - rm -rf coverage doc *.gem dist - -## coverage - Generate a test coverage report -coverage: test - -## docs - Generate documentation for the library -docs: - bundle exec rdoc lib -o docs --title "EasyPost Ruby Docs" - -## install-styleguide - Import the style guides (Unix only) -install-styleguide: | init-examples-submodule - sh examples/symlink_directory_files.sh examples/style_guides/ruby . - -## init-examples-submodule - Initialize the examples submodule -init-examples-submodule: - git submodule init - git submodule update - -## install - Install globally from source -install: | init-examples-submodule - bundle install - -## lint - Lint the project -lint: rubocop scan - -## lint-fix - Fix Rubocop errors -lint-fix: rubocop-fix - -## publish - Publishes the built gem to Rubygems -publish: - gem push dist/*.gem - -## release - 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: - gh release create ${tag} dist/* --target ${target} - -## rubocop - lints the project with rubocop -rubocop: - bundle exec rubocop - -## rubocop-fix - fix rubocop errors -rubocop-fix: - bundle exec rubocop -a - -## scan - Runs security analysis on the project with Brakeman -scan: - bundle exec brakeman lib --force - -## test - Test the project (and ignore warnings for test output) -test: - bundle exec rspec - -## update - Updates dependencies -update: | update-examples-submodule - -## update-examples-submodule - Update the examples submodule -update-examples-submodule: - git submodule init - git submodule update --remote - -.PHONY: help build clean coverage docs install install-styleguide lint lint-fix publish release rubocop rubocop-fix scan test update update-examples-submodule diff --git a/README.md b/README.md index f0b20806..a93d4ec2 100644 --- a/README.md +++ b/README.md @@ -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: . -Library documentation can be found on the web at: or by building them locally via the `make docs` command. +Library documentation can be found on the web at: or by building them locally via the `just docs` command. Upgrading major versions of this project? Refer to the [Upgrade Guide](UPGRADE_GUIDE.md). @@ -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 diff --git a/justfile b/justfile new file mode 100644 index 00000000..422fa346 --- /dev/null +++ b/justfile @@ -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