-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #71 from objectionary/54-test-against-eo-compiler
54 test against eo compiler
- Loading branch information
Showing
8 changed files
with
282 additions
and
39 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 |
---|---|---|
|
@@ -36,10 +36,29 @@ jobs: | |
!eo-phi-normalizer/Setup.hs | ||
- name: 🧰 Setup Stack | ||
# FIXME use freckle/stack-action@v4 when https://github.com/freckle/stack-action/pull/31 is merged | ||
uses: deemp/stack-action@main | ||
# FIXME use freckle/stack-action@v5 when https://github.com/freckle/stack-action/pull/36 is merged | ||
uses: deemp/stack-action@pb/v5 | ||
with: | ||
fast: ${{ github.ref_name != 'master' }} | ||
stack-build-arguments: --${{ github.ref_name != 'master' && 'fast' || '' }} --pedantic | ||
|
||
pipeline: | ||
name: "Run pipeline" | ||
# TODO run on more runners on master | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
program: [1] | ||
|
||
steps: | ||
- name: 📥 Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: 🧰 Setup Stack | ||
# FIXME use freckle/stack-action@v5 when https://github.com/freckle/stack-action/pull/36 is merged | ||
uses: deemp/stack-action@pb/v5 | ||
with: | ||
stack-build-arguments: --${{ github.ref_name != 'master' && 'fast' || '' }} --pedantic | ||
|
||
- uses: actions/setup-node@v4 | ||
with: | ||
|
@@ -52,9 +71,11 @@ jobs: | |
|
||
- name: Install EO | ||
run: npm install -g [email protected] | ||
- name: Run pipeline EO -> Phi -> Normalizer -> Phi -> EO | ||
|
||
- name: Run pipeline | ||
run: ./pipeline.sh | ||
env: | ||
PROGRAM: ${{ matrix.program }} | ||
|
||
haddock: | ||
needs: [build] | ||
|
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
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,3 @@ | ||
[args] > app | ||
QQ.io.stdout > @ | ||
"Hello, world!\n" |
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 @@ | ||
Hello, world! |
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,176 @@ | ||
+alias org.eolang.io.stdout | ||
+alias org.eolang.txt.sprintf | ||
+alias org.eolang.txt.sscanf | ||
+alias org.eolang.collections.list | ||
|
||
[n1 n2 length] > graphedge | ||
|
||
[node edges] > nodeInEdges | ||
reduce. > @ | ||
list | ||
edges | ||
FALSE | ||
[accum current] | ||
or. > @ | ||
accum | ||
or. | ||
eq. | ||
^.node | ||
current.n1 | ||
eq. | ||
^.node | ||
current.n2 | ||
|
||
[node nArray] > nodeInArray | ||
reduce. > @ | ||
list | ||
nArray | ||
FALSE | ||
[accum current] | ||
or. > @ | ||
accum | ||
eq. | ||
^.node | ||
current | ||
|
||
[edges] > nodes | ||
reduce. > @ | ||
list | ||
edges | ||
* | ||
[accum current] | ||
not. > addN1! | ||
nodeInArray | ||
current.n1 | ||
accum | ||
not. > addN2! | ||
nodeInArray | ||
current.n2 | ||
accum | ||
if. > @ | ||
and. | ||
addN1 | ||
addN2 | ||
with. | ||
with. | ||
accum | ||
current.n1 | ||
current.n2 | ||
if. | ||
and. | ||
addN1 | ||
addN2.not | ||
with. | ||
accum | ||
current.n1 | ||
if. | ||
and. | ||
addN1.not | ||
addN2 | ||
with. | ||
accum | ||
current.n2 | ||
accum | ||
|
||
[s1 s2] > join | ||
s1.as-bytes > x1 | ||
s2.as-bytes > x2 | ||
x1.concat x2 > x3 | ||
x3.as-string > @ | ||
|
||
[args...] > app | ||
[] > graph! | ||
[i] > getEdges | ||
if. > @ | ||
(i.plus 2).lt | ||
^.^.args.length | ||
with. | ||
^.getEdges | ||
i.plus 3 | ||
graphedge | ||
(sscanf "%d" (^.^.args.at i)).at 0 | ||
(sscanf "%d" (^.^.args.at (i.plus 1))).at 0 | ||
(sscanf "%d" (^.^.args.at (i.plus 2))).at 0 | ||
* | ||
if. > @ | ||
^.args.length.lt 3 | ||
* | ||
getEdges 0 | ||
|
||
nodes > graphNodes! | ||
graph | ||
|
||
[mi id] > getMin | ||
if. > @ | ||
not. | ||
lt. | ||
id | ||
^.graph.length | ||
mi | ||
if. | ||
lt. | ||
(^.graph.at id).length | ||
(^.graph.at mi).length | ||
^.getMin id (id.plus 1) | ||
^.getMin mi (id.plus 1) | ||
|
||
graph.at (getMin 0 0) > firstEdge | ||
[step] > findEdges | ||
[min id] > findNext | ||
if. > @ | ||
not. | ||
lt. | ||
id | ||
^.^.graph.length | ||
min | ||
seq | ||
nodeInEdges > n1InStep! | ||
(^.^.graph.at id).n1 | ||
^.step | ||
nodeInEdges > n2InStep! | ||
(^.^.graph.at id).n2 | ||
^.step | ||
if. | ||
and. | ||
or. | ||
and. | ||
n1InStep | ||
n2InStep.not | ||
and. | ||
n1InStep.not | ||
n2InStep | ||
or. | ||
min.eq -1 | ||
lt. | ||
(^.^.graph.at id).length | ||
(^.^.graph.at min).length | ||
^.findNext id (id.plus 1) | ||
^.findNext min (id.plus 1) | ||
findNext -1 0 > res | ||
if. > @ | ||
eq. | ||
-1 | ||
res | ||
step | ||
^.findEdges | ||
with. | ||
step | ||
(^.graph.at res) | ||
findEdges (* firstEdge) > ans! | ||
[i] > output | ||
if. > @ | ||
i.eq | ||
ans.length | ||
"" | ||
join | ||
sprintf | ||
"(%d %d - %d) " | ||
(^.ans.at i).n1 | ||
(^.ans.at i).n2 | ||
(^.ans.at i).length | ||
^.output (i.plus 1) | ||
join "MST: " (output 0) > ret | ||
stdout > @ | ||
sprintf | ||
"%s \n" | ||
ret |
Empty file.
68494bb
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wasn't able to retrieve PDD puzzles from the code base and submit them to github. If you think that it's a bug on our side, please submit it to yegor256/0pdd:
Please, copy and paste this stack trace to GitHub: