Skip to content

Commit 73c08c8

Browse files
authored
Testing use of install script in github action (#870)
1 parent 39fe39d commit 73c08c8

File tree

4 files changed

+20
-33
lines changed

4 files changed

+20
-33
lines changed

.github/buildomat/jobs/build-and-test.sh

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#:
33
#: name = "helios / build-and-test"
44
#: variety = "basic"
5-
#: target = "helios"
5+
#: target = "helios-latest"
66
#: rust_toolchain = "nightly-2022-04-27"
77
#: output_rules = []
88
#:
@@ -14,12 +14,6 @@ set -o xtrace
1414
cargo --version
1515
rustc --version
1616

17-
banner clickhouse
18-
ptime -m ./tools/ci_download_clickhouse
19-
20-
banner cockroach
21-
ptime -m bash ./tools/ci_download_cockroachdb
22-
2317
#
2418
# Set up a custom temporary directory within whatever one we were given so that
2519
# we can check later whether we left detritus around.
@@ -34,6 +28,9 @@ mkdir $TEST_TMPDIR
3428
#
3529
export PATH="$PATH:$PWD/out/cockroachdb/bin:$PWD/out/clickhouse"
3630

31+
banner prerequisites
32+
ptime -m bash ./tools/install_prerequisites.sh -y
33+
3734
#
3835
# We build with:
3936
#

.github/workflows/rust.yml

Lines changed: 6 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -102,26 +102,10 @@ jobs:
102102
103103
echo "Disk space:"
104104
df -h
105-
- name: Configure GitHub cache for CockroachDB binaries
106-
id: cache-cockroachdb
107-
# actions/cache@v2.1.4
108-
uses: actions/cache@26968a09c0ea4f3e233fdddbafd1166051a095f6
109-
with:
110-
key: ${{ runner.os }}-cockroach-binary-${{ hashFiles('tools/cockroachdb_checksums') }}
111-
path: "./out/cockroachdb"
112-
- name: Configure GitHub cache for ClickHouse binaries
113-
id: cache-clickhouse
114-
# actions/cache@v2.1.4
115-
uses: actions/cache@26968a09c0ea4f3e233fdddbafd1166051a095f6
116-
with:
117-
key: ${{ runner.os }}-clickhouse-binary-${{ hashFiles('tools/clickhouse_checksums') }}
118-
path: "./out/clickhouse"
119-
- name: Download ClickHouse
120-
if: steps.cache-clickhouse.outputs.cache-hit != 'true'
121-
run: ./tools/ci_download_clickhouse
122-
- name: Download CockroachDB binary
123-
if: steps.cache-cockroachdb.outputs.cache-hit != 'true'
124-
run: bash ./tools/ci_download_cockroachdb
105+
- name: Update PATH
106+
run: echo "$PWD/out/cockroachdb/bin:$PWD/out/clickhouse" >> "$GITHUB_PATH"
107+
- name: Install Pre-Requisites
108+
run: ./tools/install_prerequisites.sh -y
125109
- name: Create temporary directory for test outputs
126110
run: mkdir -p $OMICRON_TMP
127111
- name: Build
@@ -138,13 +122,11 @@ jobs:
138122
# - TMPDIR=$OMICRON_TMP: we specify a specific temporary directory so that
139123
# failed test outputs will be in a known place that we can grab at the
140124
# end without also grabbing random other temporary files.
141-
run: TMPDIR=$OMICRON_TMP PATH="$PATH:$PWD/out/cockroachdb/bin:$PWD/out/clickhouse" RUSTFLAGS="-D warnings" RUSTDOCFLAGS="-D warnings" cargo build --locked --all-targets --verbose
125+
run: TMPDIR=$OMICRON_TMP RUSTFLAGS="-D warnings" RUSTDOCFLAGS="-D warnings" cargo build --locked --all-targets --verbose
142126
- name: Run tests
143127
# Use the same RUSTFLAGS and RUSTDOCFLAGS as above to avoid having to
144128
# rebuild here.
145-
# Put "./cockroachdb/bin" and "./clickhouse" on the PATH for the test
146-
# suite.
147-
run: TMPDIR=$OMICRON_TMP PATH="$PATH:$PWD/out/cockroachdb/bin:$PWD/out/clickhouse" RUSTFLAGS="-D warnings" RUSTDOCFLAGS="-D warnings" cargo test --no-fail-fast --workspace --locked --verbose
129+
run: TMPDIR=$OMICRON_TMP RUSTFLAGS="-D warnings" RUSTDOCFLAGS="-D warnings" cargo test --no-fail-fast --workspace --locked --verbose
148130
- name: Archive results left by tests
149131
# actions/upload-artifact@v2.3.1
150132
uses: actions/upload-artifact@82c141cc518b40d92cc801eee768e7aafc9c2fa2

tools/ci_download_console

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,16 @@ function do_download_curl
7979

8080
function do_sha256sum
8181
{
82-
sha256sum < "$1" | awk '{print $1}'
82+
case "$OSTYPE" in
83+
darwin*)
84+
SHA="shasum -a 256"
85+
;;
86+
*)
87+
SHA="sha256sum"
88+
;;
89+
esac
90+
91+
$SHA < "$1" | awk '{print $1}'
8392
}
8493

8594
function do_untar

tools/install_prerequisites.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,6 @@ fi
123123
./tools/ci_download_cockroachdb
124124
./tools/ci_download_clickhouse
125125

126-
127126
# Install static console assets. These are used when packaging Nexus.
128127
./tools/ci_download_console
129128

0 commit comments

Comments
 (0)