@@ -6,7 +6,7 @@ concurrency:
66
77on :
88 push :
9- branches : [master, dev]
9+ branches : [master, dev, chore/improve-ci ]
1010 pull_request :
1111 types : [opened, reopened, synchronize, ready_for_review]
1212
1717 target_dir : ${{ steps.calc.outputs.dir }}
1818 steps :
1919 - id : calc
20+ env :
21+ REF_NAME : ${{ github.ref_name }}
22+ REPO_NAME : ${{ github.event.repository.name }}
2023 run : |
21- SAFE_BRANCH=$(echo "${{ github.ref_name }} " | tr '/' '-')
22- TARGET_DIR="/var/lib/gh-runners/global-targets/${{ github.event.repository.name } }-${SAFE_BRANCH}"
24+ SAFE_BRANCH=$(echo "$REF_NAME " | tr '/' '-')
25+ TARGET_DIR="/var/lib/gh-runners/global-targets/${REPO_NAME }-${SAFE_BRANCH}"
2326 mkdir -p "$TARGET_DIR"
2427 echo "dir=$TARGET_DIR" >> $GITHUB_OUTPUT
2528
4750 )
4851
4952 - name : Build binaries and tests
50- run : cargo build --bins --tests
53+ run : cargo build --bins --tests --locked
5154
5255 - name : Format check
5356 run : make ci-fmt
6770 mkdir -p "$SBF_CACHE_DIR/test-integration" "$SBF_CACHE_DIR/root"
6871
6972 if [ -d "test-integration/target/deploy" ]; then
70- cp -r test-integration/target/deploy/* "$SBF_CACHE_DIR/test-integration/"
73+ find test-integration/target/deploy -mindepth 1 -maxdepth 1 -exec cp -r {} "$SBF_CACHE_DIR/test-integration/" \;
7174 else
7275 echo "::warning::test-integration/target/deploy not found"
7376 fi
@@ -122,7 +125,7 @@ jobs:
122125 LOCAL_DEPLOY_TEST="test-integration/target/deploy"
123126 mkdir -p "$LOCAL_DEPLOY_TEST"
124127 if [ -d "$SBF_CACHE_DIR/test-integration" ]; then
125- cp -r "$SBF_CACHE_DIR/test-integration"/* "$LOCAL_DEPLOY_TEST/"
128+ find "$SBF_CACHE_DIR/test-integration" -mindepth 1 -maxdepth 1 -exec cp -r {} "$LOCAL_DEPLOY_TEST/" \;
126129 find "$LOCAL_DEPLOY_TEST" -type f -exec touch {} +
127130 else
128131 echo "::warning::No cached SBF artifacts for test-integration"
@@ -138,12 +141,14 @@ jobs:
138141 fi
139142
140143 - name : " Integration: ${{ matrix.batch }}"
144+ env :
145+ TEST_BATCH : ${{ matrix.batch }}
141146 run : |
142147 unshare -r -n bash -c '
143- set -uo pipefail
148+ set -euo pipefail
144149 ip link set lo up
145150 FAILED=""
146- for test in ${{ matrix.batch }} ; do
151+ for test in $TEST_BATCH ; do
147152 echo "========== Running: $test =========="
148153 if ! RUN_TESTS=$test make ci-test-integration PROGRAMS_SO= SKIP_CHAINLINK_PREP=1; then
149154 FAILED="$FAILED $test"
0 commit comments