Skip to content

Commit 7b83ad9

Browse files
committed
Add github action test of binary distribution
1 parent 3eababa commit 7b83ad9

File tree

2 files changed

+56
-0
lines changed

2 files changed

+56
-0
lines changed

.github/workflows/binary.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: binary tarball
2+
3+
on:
4+
workflow_dispatch:
5+
release:
6+
branches: [ master ]
7+
repository_dispatch:
8+
types: [linux-binary-test, install-test]
9+
schedule:
10+
- cron: '15 15 * * *' # 3:15pm every day
11+
jobs:
12+
build:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v3
16+
- name: prerequisites
17+
run: |
18+
sudo apt-get update
19+
sudo apt-get install -y ncbi-blast+
20+
- name: download
21+
run: bash -x .github/workflows/get_binary_release.sh > dirname
22+
- name:
23+
run: stxtyper_v*/stxtyper -v
24+
- name: run tests included with distribution
25+
run: |
26+
directory=$(cat dirname)
27+
cd $directory
28+
./test_stxtyper.sh
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#!/bin/bash
2+
# found and lightly modified these functions
3+
get_latest_release() {
4+
curl --silent "https://api.github.com/repos/$1/releases/latest" |
5+
grep '"tag_name":' |
6+
cut -d '"' -f 4
7+
}
8+
9+
get_tarball_url() {
10+
curl --silent "https://api.github.com/repos/$1/releases/latest" |
11+
fgrep '"browser_download_url":' |
12+
cut -d '"' -f 4
13+
}
14+
15+
16+
release=$(get_latest_release ncbi/stxtyper)
17+
URL=$(get_tarball_url ncbi/stxtyper)
18+
19+
>&2 echo "Downloading StxTyper version $release"
20+
>&2 echo "Binaries from $URL"
21+
22+
# download and unpack AMRFinder binaries
23+
curl --silent -L -O $URL
24+
tarball_name=$(echo $URL | perl -pe 's#^.*/(.*)#\1#')
25+
tar xfz $tarball_name
26+
rm $tarball_name
27+
directory=$(echo $tarball_name | sed 's/.tar.gz//')
28+
echo $directory

0 commit comments

Comments
 (0)