Skip to content

Commit

Permalink
build(tools): swap out Rakefile for Makefile
Browse files Browse the repository at this point in the history
simplify things for people who don't want to think about Ruby, and
hopefully in the future when we remove it entirely as a dependency
for the integration tests.
  • Loading branch information
mroth committed Feb 17, 2025
1 parent c442911 commit 179869a
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 48 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
ruby-version: '3.2'
bundler-cache: true
- name: Build binary
run: rake build
run: make build
- name: Install shells on ubuntu
if: matrix.os == 'ubuntu-latest'
run: sudo apt-get -y install zsh fish
Expand Down
9 changes: 3 additions & 6 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
## Development

While the build process itself does not require it, development uses Ruby for
integration testing because of the excellent Cucumber/Aruba package for testing
CLI tools.
While the build process itself does not require it, development currently uses
Ruby for integration testing because of the excellent Cucumber/Aruba package for
testing CLI tools.

Thus, to run integration tests, you will need to have Ruby and bundler installed
on your system. Do `bundle install` to get the test environment going.

Since we already have Ruby then for tests, we use a Rakefile instead of Makefile
since it offers some niceties. Do `rake -T` to see available tasks.

If you don't have a local Ruby environment, there is a VSCode .devcontainer
provided to make things simpler.
33 changes: 33 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# build the binary
# note starting in go1.18 vcs information will be available via go version -m
build:
@VERSION=$$(git describe --tags HEAD 2>/dev/null || echo unknown); \
echo "Building as version: $$VERSION"
go build -o bin/scmpuff -mod=readonly -ldflags "-X main.VERSION=$$VERSION"

# run unit tests
test:
go test ./...

# run integration tests (not including work in progress features)
features: build
bundle exec cucumber -s --tags='not @wip'

# run integration tests (work in progress features only)
features-wip: build
bundle exec cucumber -s --tags=@wip

# package as if for distribution
package:
goreleaser release --clean --skip publish,homebrew

# clean temp files (aruba tmp directory)
clean:
rm -rf ./tmp

# remove all build artifacts
clobber:
rm -rf ./dist
rm -f bin/scmpuff

.PHONY: build install test features features-wip package clean clobber
41 changes: 0 additions & 41 deletions Rakefile

This file was deleted.

0 comments on commit 179869a

Please sign in to comment.