Skip to content

Commit 6f23543

Browse files
authored
Merge pull request #2743 from IntersectMBO/imp_ci_grouping
feat: add group for script setup in CI scripts
2 parents 890026a + 2b09e2c commit 6f23543

File tree

4 files changed

+71
-61
lines changed

4 files changed

+71
-61
lines changed

.github/node_upgrade.sh

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,14 @@ mkdir -p "$COVERAGE_DIR"
5555
export SCHEDULING_LOG=scheduling.log
5656
true > "$SCHEDULING_LOG"
5757

58+
export DEV_CLUSTER_RUNNING=1 CLUSTERS_COUNT=1 FORBID_RESTART=1 TEST_THREADS=10 NUM_POOLS="${NUM_POOLS:-4}"
59+
unset ENABLE_LEGACY MIXED_P2P
60+
61+
echo "::endgroup::" # end group for "Script setup"
62+
63+
echo "::group::Nix env setup"
64+
printf "start: %(%H:%M:%S)T\n" -1
65+
5866
# shellcheck disable=SC1090,SC1091
5967
. .github/nix_override_cardano_node.sh
6068

@@ -70,12 +78,6 @@ else
7078
NODE_OVERRIDE=$(node_override)
7179
fi
7280

73-
export DEV_CLUSTER_RUNNING=1 CLUSTERS_COUNT=1 FORBID_RESTART=1 TEST_THREADS=10 NUM_POOLS="${NUM_POOLS:-4}"
74-
unset ENABLE_LEGACY MIXED_P2P
75-
76-
echo "::group::Nix env setup"
77-
printf "start: %(%H:%M:%S)T\n" -1
78-
7981
set +e
8082
# shellcheck disable=SC2086
8183
nix flake update --accept-flake-config $NODE_OVERRIDE
@@ -89,7 +91,7 @@ nix develop --accept-flake-config .#venv --command bash -c '
8991
. .github/setup_venv.sh clean
9092
echo "::endgroup::" # end group for "Python venv setup"
9193

92-
echo "::group::Pytest step1"
94+
echo "::group::-> PYTEST STEP1 <-"
9395
df -h .
9496
# prepare scripts for stating cluster instance, start cluster instance, run smoke tests
9597
./.github/node_upgrade_pytest.sh step1
@@ -104,8 +106,8 @@ fi
104106
# retval 0 == all tests passed; 1 == some tests failed; > 1 == some runtime error and we don't want to continue
105107
[ "$retval" -le 1 ] || exit "$retval"
106108

107-
echo "::endgroup::" # end group for "Pytest step1"
108-
echo "::group::Pytest step2"
109+
echo "::endgroup::" # end group for "-> PYTEST STEP1 <-"
110+
echo "::group::-> PYTEST STEP2 <-"
109111

110112
# update cardano-node to specified branch and/or revision, or to the latest available revision
111113
if [ -n "${UPGRADE_REVISION:-""}" ]; then
@@ -130,14 +132,14 @@ nix develop --accept-flake-config .#venv --command bash -c '
130132
retval="$?"
131133
# retval 0 == all tests passed; 1 == some tests failed; > 1 == some runtime error and we dont want to continue
132134
[ "$retval" -le 1 ] || exit "$retval"
133-
echo "::endgroup::" # end group for "Pytest step2"
135+
echo "::endgroup::" # end group for "-> PYTEST STEP2 <-"
134136

135-
echo "::group::Pytest step3"
137+
echo "::group::-> PYTEST STEP3 <-"
136138
df -h .
137139
# update to Conway, run smoke tests
138140
./.github/node_upgrade_pytest.sh step3
139141
retval="$?"
140-
echo "::endgroup::" # end group for "Pytest step3"
142+
echo "::endgroup::" # end group for "-> PYTEST STEP3 <-"
141143

142144
echo "::group::Cluster teardown & artifacts"
143145
# teardown cluster

.github/regression.sh

Lines changed: 48 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -26,48 +26,6 @@ mkdir -p "$WORKDIR"
2626
export TMPDIR="$WORKDIR/tmp"
2727
mkdir -p "$TMPDIR"
2828

29-
# setup dbsync (disabled by default)
30-
case "${DBSYNC_REV:-""}" in
31-
"" )
32-
;;
33-
"none" )
34-
unset DBSYNC_REV
35-
;;
36-
* )
37-
# shellcheck disable=SC1090,SC1091
38-
. .github/source_dbsync.sh
39-
df -h .
40-
;;
41-
esac
42-
43-
# Setup plutus-apps (disabled by default).
44-
# The "plutus-apps" repo is needed for the `create-script-context` tool, which is used by the
45-
# Plutus tests that are testing script context.
46-
# TODO: The `create-script-context` tool is broken for a very long time, hence disabled.
47-
# See https://github.com/IntersectMBO/plutus-apps/issues/1107
48-
case "${PLUTUS_APPS_REV:="none"}" in
49-
"none" )
50-
unset PLUTUS_APPS_REV
51-
;;
52-
* )
53-
# shellcheck disable=SC1090,SC1091
54-
. .github/source_plutus_apps.sh
55-
;;
56-
esac
57-
58-
# setup cardano-cli (use the built-in version by default)
59-
case "${CARDANO_CLI_REV:-""}" in
60-
"" )
61-
;;
62-
"none" )
63-
unset CARDANO_CLI_REV
64-
;;
65-
* )
66-
# shellcheck disable=SC1090,SC1091
67-
. .github/source_cardano_cli.sh
68-
;;
69-
esac
70-
7129
if [ "${CI_TOPOLOGY:-""}" = "legacy" ]; then
7230
export ENABLE_LEGACY=1
7331
elif [ "${CI_TOPOLOGY:-""}" = "mixed" ]; then
@@ -127,9 +85,49 @@ if [ -n "${BOOTSTRAP_DIR:-""}" ]; then
12785
export MAKE_TARGET="${MAKE_TARGET:-"testnets"}"
12886
fi
12987

130-
# function to update cardano-node to specified branch and/or revision, or to the latest available
131-
# shellcheck disable=SC1090,SC1091
132-
. .github/nix_override_cardano_node.sh
88+
echo "::endgroup::" # end group for "Script setup"
89+
90+
# setup dbsync (disabled by default)
91+
case "${DBSYNC_REV:-""}" in
92+
"" )
93+
;;
94+
"none" )
95+
unset DBSYNC_REV
96+
;;
97+
* )
98+
# shellcheck disable=SC1090,SC1091
99+
. .github/source_dbsync.sh
100+
df -h .
101+
;;
102+
esac
103+
104+
# Setup plutus-apps (disabled by default).
105+
# The "plutus-apps" repo is needed for the `create-script-context` tool, which is used by the
106+
# Plutus tests that are testing script context.
107+
# TODO: The `create-script-context` tool is broken for a very long time, hence disabled.
108+
# See https://github.com/IntersectMBO/plutus-apps/issues/1107
109+
case "${PLUTUS_APPS_REV:="none"}" in
110+
"none" )
111+
unset PLUTUS_APPS_REV
112+
;;
113+
* )
114+
# shellcheck disable=SC1090,SC1091
115+
. .github/source_plutus_apps.sh
116+
;;
117+
esac
118+
119+
# setup cardano-cli (use the built-in version by default)
120+
case "${CARDANO_CLI_REV:-""}" in
121+
"" )
122+
;;
123+
"none" )
124+
unset CARDANO_CLI_REV
125+
;;
126+
* )
127+
# shellcheck disable=SC1090,SC1091
128+
. .github/source_cardano_cli.sh
129+
;;
130+
esac
133131

134132
_cleanup() {
135133
# stop all running cluster instances
@@ -176,6 +174,10 @@ trap 'set +e; _interrupted; exit 130' SIGINT
176174
echo "::group::Nix env setup"
177175
printf "start: %(%H:%M:%S)T\n" -1
178176
177+
# function to update cardano-node to specified branch and/or revision, or to the latest available
178+
# shellcheck disable=SC1090,SC1091
179+
. .github/nix_override_cardano_node.sh
180+
179181
# run tests and generate report
180182
set +e
181183
# shellcheck disable=SC2046,SC2119
@@ -190,7 +192,7 @@ nix develop --accept-flake-config .#venv --command bash -c '
190192
. .github/setup_venv.sh clean
191193
echo "::endgroup::" # end group for "Python venv setup"
192194

193-
echo "::group::Pytest run"
195+
echo "::group::-> PYTEST RUN <-"
194196
export PATH="${PWD}/.bin":"$WORKDIR/cardano-cli/cardano-cli-build/bin":"$PATH"
195197
export CARDANO_NODE_SOCKET_PATH="$CARDANO_NODE_SOCKET_PATH_CI"
196198
make "${MAKE_TARGET:-"tests"}"

.github/workflows/regression_reusable.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,10 @@ jobs:
108108
fi
109109
- name: Run CLI regression tests
110110
id: testing-step
111-
run: .github/regression.sh
111+
run: |
112+
# Regression Tests
113+
echo "::group::Script setup"
114+
.github/regression.sh
112115
- name: Report test results
113116
if: (success() || failure()) && inputs.testrun_name
114117
run: |

.github/workflows/upgrade_reusable.yaml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,12 @@ jobs:
4343
cat .github_ci_env
4444
cat .github_ci_env >> $GITHUB_ENV
4545
echo "GITHUB_TOKEN=${{ secrets.GH_TOKEN }}" >> $GITHUB_ENV
46-
- name: Run CLI regression tests
46+
- name: Run upgrade tests
4747
id: testing-step
48-
run: ./.github/node_upgrade.sh
48+
run: |
49+
# Upgrade Tests
50+
echo "::group::Script setup"
51+
./.github/node_upgrade.sh
4952
- name: Upload testing artifacts on failure
5053
uses: actions/upload-artifact@v4
5154
if: failure()

0 commit comments

Comments
 (0)