-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: use just instead of GNU make (#515)
* refactor: use just instead of GNU make Just is a more modern alternative to make. See https://github.com/casey/just
- Loading branch information
1 parent
bff42c2
commit 5199400
Showing
4 changed files
with
75 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,7 +12,7 @@ jobs: | |
with: | ||
# Github secret token | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
# selene arguments, should be the same as in ../../Makefile | ||
# selene arguments, should be the same as in ../../justfile | ||
args: | ||
--display-style=quiet ./lua/ ./spec/ | ||
./integration-tests/test-environment/config-modifications | ||
|
@@ -24,3 +24,14 @@ jobs: | |
runs-on: ubuntu-latest | ||
steps: | ||
- uses: DavidAnson/[email protected] | ||
|
||
just: | ||
name: just | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: extractions/setup-just@v1 | ||
# https://github.com/casey/just | ||
# use the latest version, probably doesn't matter much | ||
|
||
- name: Run just format check | ||
run: just --fmt --check |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
set unstable := true | ||
|
||
# allow `just --fmt` | ||
|
||
COLOR_RESET := '\033[0m' | ||
COLOR_GREEN := '\033[1;32m' | ||
COLOR_BLUE_ := '\033[1;34m' | ||
COLOR_YELLO := '\033[1;33m' | ||
COLOR_WHITE := '\033[1;37m' | ||
|
||
default: help | ||
|
||
@help: | ||
just --list | ||
|
||
# Build the project | ||
@build: | ||
echo "Building project..." | ||
luarocks init --no-gitignore | ||
luarocks install busted 2.2.0-1 | ||
|
||
just help | ||
|
||
# Check the code for lint errors | ||
lint: | ||
selene ./lua/ ./spec/ ./integration-tests/test-environment/config-modifications | ||
|
||
@if grep -r -e "#focus" --include \*.lua ./spec/; then \ | ||
echo "\n"; \ | ||
echo "Error: {{ COLOR_GREEN }}#focus{{ COLOR_RESET }} tags found in the codebase.\n"; \ | ||
echo "Please remove them to prevent issues with not accidentally running all tests."; \ | ||
exit 1; \ | ||
fi | ||
|
||
# Run all tests | ||
test: | ||
luarocks test --local | ||
|
||
# Run only the tests marked with #focus somewhere in the test name | ||
test-focus: | ||
luarocks test --local -- --filter=focus | ||
|
||
# Reformat all code | ||
format: | ||
stylua lua/ spec/ integration-tests/ ./repro.lua | ||
|
||
# Check the code for errors (lint + test + format) | ||
check: lint test format |