Skip to content

Commit

Permalink
Merge pull request #28 from objectionary/27-fix-pipeline
Browse files Browse the repository at this point in the history
27 fix pipeline
  • Loading branch information
fizruk authored Jan 15, 2024
2 parents b8e928c + 6d84d2d commit 921047e
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 10 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/ghc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,11 @@ jobs:
distribution: "zulu"
java-version: 21

- run: npm install -g [email protected]

- run: ./pipeline.sh
- name: Install EO
run: npm install -g [email protected]

- name: Run pipeline EO -> Phi -> Normalizer -> Phi -> EO
run: ./pipeline.sh

haddock:
needs: [build]
Expand Down
11 changes: 8 additions & 3 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -145,10 +145,15 @@
"${packageName}" = haskellPackages."${packageName}";

pipeline = {
runtimeInputs = [ stack pkgs.jdk21 packages.eoc pkgs.maven ];
runtimeInputs = [
stack
pkgs.jdk21
packages.eoc
pkgs.maven
pkgs.perl
];
text = ''
JAVA_HOME="${pkgs.jdk21.home}"
export JAVA_HOME
export JAVA_HOME="${pkgs.jdk21.home}"
${builtins.readFile ./pipeline.sh}
'';
description = "Run pipeline";
Expand Down
13 changes: 9 additions & 4 deletions pipeline.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
set -euo pipefail

mkdir -p pipeline
cd pipeline

shopt -s expand_aliases

EO=0.34.2
EO="0.34.3"
alias eo="eoc --parser=${EO}"

cat > app.eo <<EOT
Expand All @@ -24,7 +26,7 @@ I=".eoc/phi/app.bk.phi"
mv "$IO" "$I"
stack run normalize-phi < "$I" > "$IO" \
|| {
printf "\n\nNormalizer failed"
printf "\n\nNormalizer failed!"
printf "\n\n* EO expression:\n\n"
cat app.eo
printf "\n\n* Phi expression:\n\n"
Expand All @@ -33,14 +35,17 @@ stack run normalize-phi < "$I" > "$IO" \
cat "$IO"
exit 1
}
perl -i -pe 'chomp if eof' "$IO"

printf "\n\nNormalizer succeeded!\n\n"
printf "\n\nNormalizer succeeded!"
printf "\n\n* EO expression:\n\n"
cat app.eo
printf "\n\n* Phi expression:\n\n"
cat "$I"
printf "\n\n* Normalized Phi expression:\n\n"
cat "$IO"
printf "\n\n* Diff:\n\n"
diff "$I" "$IO"
diff "$I" "$IO" || true

eo unphi

Expand Down

0 comments on commit 921047e

Please sign in to comment.