Skip to content

adds Github action workflow for building and testing #1

adds Github action workflow for building and testing

adds Github action workflow for building and testing #1

Workflow file for this run

# This workflow will install RGI dependencies, run tests and lint with a variety of Python versions
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
name: Build RGI and test
on:
push:
branches: [ 'master' ]
pull_request:
branches: [ 'master' ]
workflow_dispatch:
env:
BLAST_VERSION: 2.9.0
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.6"]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
sudo apt-get -qq update
sudo apt-get install -y prodigal
sudo apt-get install -y libtbb-dev
# install blast
wget http://ftp.ncbi.nlm.nih.gov/blast/executables/blast+/${BLAST_VERSION}/ncbi-blast-${BLAST_VERSION}+-x64-linux.tar.gz
tar xzf ncbi-blast-${BLAST_VERSION}+-x64-linux.tar.gz
sudo mv ncbi-blast-${BLAST_VERSION}+/bin/* /usr/bin
# bowtie2
wget https://github.com/BenLangmead/bowtie2/releases/download/v2.4.5/bowtie2-2.4.5-linux-x86_64.zip
unzip bowtie2-2.4.5-linux-x86_64.zip
sudo mv bowtie2-2.4.5-linux-x86_64/bowtie2* /usr/bin
# diamond
wget http://github.com/bbuchfink/diamond/releases/download/v0.8.36/diamond-linux64.tar.gz
tar xzf diamond-linux64.tar.gz
sudo mv diamond /usr/bin
# samtools
wget https://github.com/samtools/samtools/releases/download/1.9/samtools-1.9.tar.bz2
tar jxf samtools-1.9.tar.bz2
pushd samtools-1.9 && ./configure && make && sudo mv samtools /usr/bin && popd
# bamtools
wget https://github.com/pezmaster31/bamtools/archive/v2.5.1.tar.gz
tar xzf v2.5.1.tar.gz
pushd bamtools-2.5.1/ && mkdir build && cd build && cmake .. && make && sudo make install && popd
# bedtools
wget https://github.com/arq5x/bedtools2/releases/download/v2.28.0/bedtools
chmod +x bedtools && sudo mv bedtools /usr/bin
# bwa
git clone https://github.com/lh3/bwa.git
pushd bwa && make && sudo mv bwa /usr/bin && popd
# jellyfish
wget https://github.com/gmarcais/Jellyfish/releases/download/v2.2.10/jellyfish-linux
mv jellyfish-linux jellyfish && chmod +x jellyfish && sudo mv jellyfish /usr/bin
# kma
git clone https://bitbucket.org/genomicepidemiology/kma.git
pushd kma && make && sudo mv kma /usr/bin && popd
python -m pip install --upgrade pip
python -m pip install flake8 pytest
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with pytest
run: |
./test.sh