Bystro Annotator Install Script (RPM) #197
Workflow file for this run
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
name: Bystro Annotator Install Script (RPM) | |
on: | |
release: | |
types: [published] | |
pull_request: | |
paths: | |
- "install-rpm.sh" | |
- "install/**" | |
workflow_dispatch: # Optional: allows manual triggering of the workflow | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
container: | |
image: amazonlinux:2023 | |
steps: | |
- name: Install dependencies | |
run: | | |
dnf install -y sudo tar | |
# Checkout the repository | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
# Run the install script | |
- name: Install Bystro using RPM script | |
run: | | |
touch ~/.profile | |
./install-rpm.sh --profile-file ~/.profile | |
# Test that bystro-annotate.pl works | |
# When it runs with --help it exits with 255 | |
- name: Verify installation by running bystro-annotate.pl --help | |
continue-on-error: true | |
run: | | |
source ~/.profile | |
output=$(bystro-annotate.pl --help 2>&1) | |
exit_code=$? | |
first_line=$(echo "$output" | head -n 1) | |
if [ "$exit_code" -eq 255 ]; then | |
echo "Exit code 255 confirmed." | |
else | |
echo "Unexpected exit code: $exit_code" >&2 | |
exit 1 | |
fi | |
if [[ "$first_line" == "usage: bystro-annotate.pl"* ]]; then | |
echo "First line matches the expected 'usage: bystro-annotate.pl'." | |
else | |
echo "First line does not match the expected 'usage: bystro-annotate.pl'." >&2 | |
echo "Actual first line: $first_line" >&2 | |
exit 1 | |
fi | |
# Test that bystro-build.pl works | |
# when it runs with --help it exits with 1 | |
- name: Verify installation by running bystro-build.pl --help | |
continue-on-error: true | |
run: | | |
source ~/.profile | |
output=$(bystro-build.pl --help 2>&1) | |
first_line=$(echo "$output" | head -n 1) | |
if [[ "$first_line" == "Usage:"* ]]; then | |
echo "First line matches the expected 'Usage:'" | |
else | |
echo "First line does not match the expected 'Usage:'" >&2 | |
echo "Actual first line: $first_line" >&2 | |
exit 1 | |
fi | |
- name: Run tests | |
run: | | |
cd perl | |
source ~/.profile | |
prove -r -j$(nproc) t | |
- name: Check that expected programs are in the PATH | |
run: | | |
source ~/.profile | |
if command -v bystro-annotate.pl > /dev/null; then | |
echo "bystro-annotate.pl is in the PATH" | |
else | |
echo "bystro-annotate.pl is not in the PATH" >&2 | |
exit 1 | |
fi | |
if command -v bystro-build.pl > /dev/null; then | |
echo "bystro-build.pl is in the PATH" | |
else | |
echo "bystro-build.pl is not in the PATH" >&2 | |
exit 1 | |
fi | |
if command -v bystro-vcf > /dev/null; then | |
echo "bystro-vcf is in the PATH" | |
else | |
echo "bystro-vcf is not in the PATH" >&2 | |
exit 1 | |
fi | |
if command -v bystro-snp > /dev/null; then | |
echo "bystro-snp is in the PATH" | |
else | |
echo "bystro-snp is not in the PATH" >&2 | |
exit 1 | |
fi | |
if command -v bystro-stats > /dev/null; then | |
echo "bystro-stats is in the PATH" | |
else | |
echo "bystro-stats is not in the PATH" >&2 | |
exit 1 | |
fi | |
if command -v bgzip > /dev/null; then | |
echo "bgzip is in the PATH" | |
else | |
echo "bgzip is not in the PATH" >&2 | |
exit 1 | |
fi | |
if command -v yq > /dev/null; then | |
echo "yq is in the PATH" | |
else | |
echo "yq is not in the PATH" >&2 | |
exit 1 | |
fi |