-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #67 from paulsengroup/update-ci
Update build-dockerfile workflow to test image after build
- Loading branch information
Showing
2 changed files
with
84 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Copyright (c) 2023 Roberto Rossini <roberros@uio.no> | ||
# | ||
# SPDX-License-Identifier: MIT | ||
|
||
set -eu | ||
set -o pipefail | ||
|
||
if [ $# -ne 1 ]; then | ||
2>&1 echo "Usage: $0 hictk:latest" | ||
status=1 | ||
fi | ||
|
||
IMG="$1" | ||
|
||
tmpdir="$(mktemp -d)" | ||
trap "rm -rf '$tmpdir'" EXIT | ||
|
||
cat > "$tmpdir/runme.sh" <<- 'EOM' | ||
set -eu | ||
cd /tmp/hictk | ||
apt-get update | ||
apt-get install -y --no-install-recommends \ | ||
curl \ | ||
python3 \ | ||
xz-utils | ||
tar -xf test/data/hictk_test_data.tar.xz | ||
tmpdir="$(mktemp -d)" | ||
trap "rm -rf '$tmpdir'" EXIT | ||
hic_tools_url='https://github.com/aidenlab/HiCTools/releases/download/v3.30.00/hic_tools.3.30.00.jar' | ||
curl -L "$hic_tools_url" -o "$tmpdir/hic_tools.jar" | ||
whereis -b hictk | ||
test/scripts/hictk_convert_hic2cool.sh "$(which hictk)" | ||
test/scripts/hictk_convert_cool2hic.sh "$(which hictk)" "$tmpdir/hic_tools.jar" | ||
EOM | ||
|
||
chmod 755 "$tmpdir/runme.sh" | ||
|
||
sudo docker run --rm --entrypoint=/bin/bash \ | ||
-v "$tmpdir/runme.sh:/tmp/runme.sh:ro" \ | ||
-v "$PWD/test/scripts:/tmp/hictk/test/scripts:ro" \ | ||
-v "$PWD/test/data/hictk_test_data.tar.xz:/tmp/hictk/test/data/hictk_test_data.tar.xz:ro" \ | ||
"$IMG" \ | ||
/tmp/runme.sh |