Skip to content

Commit 2704f2d

Browse files
committed
Move "Sanity test fixtures" code into a script
1 parent fd363f1 commit 2704f2d

File tree

2 files changed

+39
-23
lines changed

2 files changed

+39
-23
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -114,29 +114,7 @@ jobs:
114114
run: cargo build
115115

116116
- name: Sanity test fixtures
117-
run: |
118-
AGAVE_TAG="$(cat agave_tag.txt)"
119-
case "$(uname -s)" in
120-
Darwin)
121-
EXT=macOS
122-
;;
123-
Linux)
124-
EXT=Linux
125-
;;
126-
*)
127-
esac
128-
for X in fixtures/*; do
129-
if [[ "$X" = fixtures/retry ]]; then
130-
continue
131-
fi
132-
pushd "$X"
133-
yarn
134-
wget --quiet https://github.com/trail-of-forks/sbpf-coverage/releases/download/$AGAVE_TAG/patched-agave-tools-$AGAVE_TAG-$EXT.tar.gz
135-
tar xzf patched-agave-tools-$AGAVE_TAG-$EXT.tar.gz
136-
PATH="$PWD/patched-agave-tools-$AGAVE_TAG-$EXT/bin:$PATH"
137-
anchor test
138-
popd
139-
done
117+
run: scripts/anchor_test_fixtures.sh
140118

141119
- name: Test
142120
run: |

scripts/anchor_test_fixtures.sh

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
#! /bin/bash
2+
3+
# smoelius: This script tests the fixtures with `anchor test` rather than `anchor-coverage`.
4+
5+
set -euo pipefail
6+
7+
AGAVE_TAG="$(cat agave_tag.txt)"
8+
9+
case "$(uname -s)" in
10+
Darwin)
11+
EXT=macOS
12+
;;
13+
Linux)
14+
EXT=Linux
15+
;;
16+
*)
17+
esac
18+
19+
for X in fixtures/*; do
20+
if [[ "$X" = fixtures/retry ]]; then
21+
continue
22+
fi
23+
24+
pushd "$X"
25+
26+
yarn
27+
28+
wget --quiet https://github.com/trail-of-forks/sbpf-coverage/releases/download/$AGAVE_TAG/patched-agave-tools-$AGAVE_TAG-$EXT.tar.gz
29+
30+
tar xzf patched-agave-tools-$AGAVE_TAG-$EXT.tar.gz
31+
32+
# smoelius: `anchor-coverage` will find and use the patched tools, but `anchor test` will not.
33+
PATH="$PWD/patched-agave-tools-$AGAVE_TAG-$EXT/bin:$PATH"
34+
35+
anchor test
36+
37+
popd
38+
done

0 commit comments

Comments
 (0)