-
Notifications
You must be signed in to change notification settings - Fork 0
77 lines (67 loc) · 2.81 KB
/
demo.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
name: Demo
on:
push:
branches: ["main"]
pull_request:
types: ["opened", "synchronize", "reopened"]
permissions:
contents: read
jobs:
demo_with_polynomial_time_without_correctness:
# NOTE: Run on Ubuntu of Docker in my computer
runs-on: ubuntu-22.04
container:
image: erlang:26.2.1
defaults:
run:
working-directory: ./demo
steps:
- uses: actions/checkout@v3
- name: Demonstrate with polynomial_time_without_correctness
run: |
mkdir _checkouts
ln -s ${PWD}/../ _checkouts/bean
rebar3 bean
# NOTE:
# The processing of the following three commands can be achieved
# in some environments with the command
# `[ $(rebar3 shell --script run.escript | grep 'Result: 55' | wc -l) -eq 2 ]` alone.
# However, when the command are executed in GitHub Actions,
# the evaluation of `supervisor:start_link(bean, [])` causes a "Terminating erlang" error.
# The cause of this problem seems to depend on
# whether or not the Erlang runtime system is started with a shell
# (i.e., with or without `-noshell` at startup).
# Unfortunately, this option is currently not supported by Rebar3,
# so I used `erl` directly to solve this problem.
rebar3 compile
erlc run.erl
[ $(erl -pa _build/default/lib/demo/ebin -run run main -noshell | grep 'Result: 55' | wc -l) -eq 2 ]
demo_with_exp_time_with_correctness:
# NOTE: Run on Ubuntu of Docker in my computer
runs-on: ubuntu-22.04
container:
image: erlang:26.2.1
defaults:
run:
working-directory: ./demo
steps:
- uses: actions/checkout@v3
- name: Demonstrate with polynomial_time_without_correctness
run: |
mkdir _checkouts
ln -s ${PWD}/../ _checkouts/bean
rebar3 bean --algorithm exp_time_with_correctness
# NOTE:
# The processing of the following three commands can be achieved
# in some environments with the command
# `[ $(rebar3 shell --script run.escript | grep 'Result: 55' | wc -l) -eq 2 ]` alone.
# However, when the command are executed in GitHub Actions,
# the evaluation of `supervisor:start_link(bean, [])` causes a "Terminating erlang" error.
# The cause of this problem seems to depend on
# whether or not the Erlang runtime system is started with a shell
# (i.e., with or without `-noshell` at startup).
# Unfortunately, this option is currently not supported by Rebar3,
# so I used `erl` directly to solve this problem.
rebar3 compile
erlc run.erl
[ $(erl -pa _build/default/lib/demo/ebin -run run main -noshell | grep 'Result: 55' | wc -l) -eq 2 ]