1
1
# shellcheck shell=bash
2
2
3
+ set unstable := true
4
+
3
5
format :
4
- #!/usr/bin/env bash
5
- fourmolu -i src app test test-E2E test-lib CI/ rewrite-libs
6
- cabal-fmt -i anti.cabal CI/ rewrite-libs/ rewrite-libs.cabal
7
- nixfmt *.nix
8
- nixfmt nix/ *.nix
9
- nixfmt CI/ rewrite-libs/ *.nix
10
- nixfmt CI/ rewrite-libs/ nix/ *.nix
6
+ #!/usr/bin/env bash
7
+ fourmolu -i src app test test-E2E test-lib CI/ rewrite-libs
8
+ cabal-fmt -i anti.cabal CI/ rewrite-libs/ rewrite-libs.cabal
9
+ nixfmt *.nix
10
+ nixfmt nix/ *.nix
11
+ nixfmt CI/ rewrite-libs/ *.nix
12
+ nixfmt CI/ rewrite-libs/ nix/ *.nix
11
13
12
14
hlint :
13
- #!/usr/bin/env bash
14
- hlint app src test test-E2E test-lib CI/ rewrite-libs
15
+ #!/usr/bin/env bash
16
+ hlint app src test test-E2E test-lib CI/ rewrite-libs
15
17
16
18
unit match = " ":
17
- #!/usr/bin/env bash
18
- # shellcheck disable=SC2050
19
- if [[ ' {{ match}} ' == " " ]]; then
20
- cabal test anti-unit-test \
21
- - -test-show-details=direct
22
- else
23
- cabal test anti-unit-test\
24
- - -test-show-details=direct \
25
- - -test-option=--match \
26
- - -test-option=" {{ match}} "
27
- fi
19
+ #!/usr/bin/env bash
20
+ # shellcheck disable=SC2050
21
+ if [[ ' {{ match }} ' == " " ]]; then
22
+ cabal test anti-unit-test \
23
+ - -test-show-details=direct
24
+ else
25
+ cabal test anti-unit-test\
26
+ - -test-show-details=direct \
27
+ - -test-option=--match \
28
+ - -test-option=" {{ match }} "
29
+ fi
30
+
28
31
build :
29
32
#!/usr/bin/env bash
30
33
cabal build all --enable-tests
31
34
32
-
33
35
E2E match = " ":
34
36
#!/usr/bin/env bash
35
37
mkdir -p tmp/ bin
@@ -95,35 +97,69 @@ E2E match="":
95
97
owner=$(anti wallet info | jq -r ' .owner' )
96
98
export ANTI_AGENT_PUBLIC_KEY_HASH=$owner
97
99
echo " Starting E2E tests..."
98
- just E2E-tests " {{ match}} "
100
+ just E2E-tests " {{ match }} "
99
101
100
102
E2E-tests match = " ":
101
103
#!/usr/bin/env bash
102
104
# shellcheck disable=SC2050
103
- if [[ ' {{ match}} ' == " " ]]; then
105
+ if [[ ' {{ match }} ' == " " ]]; then
104
106
cabal test anti-E2E-test \
105
107
- -test-show-details=direct
106
108
else
107
109
cabal test anti-E2E-test \
108
110
- -test-show-details=direct \
109
111
- -test-option=--match \
110
- - -test-option=" {{ match}} "
112
+ - -test-option=" {{ match }} "
111
113
fi
112
114
113
115
CI :
114
- #!/usr/bin/env bash
115
- set -euo pipefail
116
- just build
117
- just unit
118
- just E2E
119
- cabal-fmt -c anti.cabal CI/ rewrite-libs/ rewrite-libs.cabal
120
- fourmolu -m check src app test CI/ rewrite-libs
121
- hlint -c src app test CI/ rewrite-libs
116
+ #!/usr/bin/env bash
117
+ set -euo pipefail
118
+ just build
119
+ just unit
120
+ just E2E
121
+ cabal-fmt -c anti.cabal CI/ rewrite-libs/ rewrite-libs.cabal
122
+ fourmolu -m check src app test CI/ rewrite-libs
123
+ hlint -c src app test CI/ rewrite-libs
122
124
123
125
start-mpfs :
124
- #!/usr/bin/env bash
125
- docker compose -p " anti-testing" -f test-E2E/ fixtures/ docker-compose.yml up -d
126
+ #!/usr/bin/env bash
127
+ docker compose -p " anti-testing" -f test-E2E/ fixtures/ docker-compose.yml up -d
126
128
127
129
stop-mpfs :
128
- #!/usr/bin/env bash
129
- docker compose -p " anti-testing" -f test-E2E/ fixtures/ docker-compose.yml down
130
+ #!/usr/bin/env bash
131
+ docker compose -p " anti-testing" -f test-E2E/ fixtures/ docker-compose.yml down
132
+
133
+ start-anti-agent bg = " false":
134
+ #!/usr/bin/env bash
135
+ nix build .#anti-agent-docker-image
136
+ docker load < result
137
+ version=$(nix eval --raw .#version)
138
+ docker image tag cardano-foundation/ anti-agent:" $version" cardano-foundation/ anti-agent:latest
139
+ # shellcheck disable=SC2050
140
+ if [[ ' {{ bg }} ' == " true" ]]; then
141
+ docker compose -f CD/ anti-agent/ docker-compose.yaml up -d
142
+ else
143
+ docker compose -f CD/ anti-agent/ docker-compose.yaml up
144
+ fi
145
+
146
+ logs-anti-agent :
147
+ #!/usr/bin/env bash
148
+ docker compose -f CD/ anti-agent/ docker-compose.yaml logs -f
149
+
150
+ start-anti-oracle bg = " false":
151
+ #!/usr/bin/env bash
152
+ nix build .#anti-oracle-docker-image
153
+ docker load < result
154
+ version=$(nix eval --raw .#version)
155
+ docker image tag cardano-foundation/ anti-oracle:" $version" cardano-foundation/ anti-oracle:latest
156
+ # shellcheck disable=SC2050
157
+ if [[ ' {{ bg }} ' == " true" ]]; then
158
+ docker compose -f CD/ anti-oracle/ docker-compose.yaml up -d
159
+ else
160
+ docker compose -f CD/ anti-oracle/ docker-compose.yaml up
161
+ fi
162
+
163
+ logs-anti-oracle :
164
+ #!/usr/bin/env bash
165
+ docker compose -f CD/ anti-oracle/ docker-compose.yaml logs -f
0 commit comments