Skip to content

Commit

Permalink
fix(cicd): flush checkPhase logs to stdout
Browse files Browse the repository at this point in the history
  • Loading branch information
piotr-semenov committed May 22, 2024
1 parent 05cf9c8 commit f0c52cd
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 9 deletions.
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ test: $(BUILD_DIR)parigp.tmLanguage.json
--grammar $(BUILD_DIR)parigp.tmLanguage.json \
$(TEST_CASES)

$(BUILD_DIR)gp_commands.tsv:
$(BUILD_DIR)gp_commands.tsv: $(BUILD_DIR)
$(eval FUNCS := $(shell echo '\c' | gp -fq | grep -v 'RETURN'))
@printf 'Command\tType\n' > $@
@echo $(FUNCS) |\
Expand All @@ -84,13 +84,13 @@ define get_gp_list
xargs -I@ $(SHELL) -c 'echo -e \@"\n"' | xargs $(4) >> $@
endef

$(BUILD_DIR)gp_member_functions.tsv:
$(BUILD_DIR)gp_member_functions.tsv: $(BUILD_DIR)
$(call get_gp_list,'Member','?.',,-n1)

$(BUILD_DIR)gp_types.tsv:
$(BUILD_DIR)gp_types.tsv: $(BUILD_DIR)
$(call get_gp_list,'Type','\\t',tail -n+2 |,-n1)

$(BUILD_DIR)gp_support_commands.tsv:
$(BUILD_DIR)gp_support_commands.tsv: $(BUILD_DIR)
$(call get_gp_list,'MetaCommand','?\\',tail -n+4 | cut -d'{' -f1 | cut -d' ' -f1 |,-I@ echo '\@')

GP_ITEMS := commands member_functions types support_commands
Expand Down
2 changes: 2 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
yq-go
gnumake
gnused

python39
jinja2-cli

Expand All @@ -47,6 +48,7 @@
vscode_tmgrammar_test
];
src = self;
configurePhase = "make clean";
buildPhase = "make build";
checkPhase = "make test";
installPhase = "mkdir -p $out; cp syntaxes/* $out/";
Expand Down
17 changes: 12 additions & 5 deletions scripts/compile-grammar.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
# compile-grammar.sh - Builds TextMate grammar with help of Nix.

# shellcheck shell=sh
set -e


scriptPath=$(readlink -f "$0")
Expand All @@ -12,7 +11,15 @@ rootDir=$(dirname "${scriptPath%/*}")
statix check
nix flake check --impure "$rootDir"

cp "$(nix build --impure \
--no-link \
--print-out-paths "$rootDir")"/parigp* "$rootDir/syntaxes/"
nix develop --check --impure "$rootDir"
outDir="$(nix build --impure \
--no-link \
--print-build-logs \
--print-out-paths "$rootDir")"
cp "$outDir"/parigp* "$rootDir/syntaxes/"

output=$(nix develop --check --impure "$rootDir")
echo "$output"
output=$(echo "$output" | grep '✖.*failed')
if [ -n "$output" ]; then
exit 1
fi

0 comments on commit f0c52cd

Please sign in to comment.