Always use Mykrobe-tools/mccortex #63
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: Mykrobe builds | |
on: | |
push: | |
tags: | |
- 'v*.*.*' | |
branches: | |
- master | |
pull_request: | |
branches: | |
- master | |
env: | |
REGISTRY: ghcr.io | |
IMAGE_NAME: ${{ github.repository }} | |
jobs: | |
build_containers: | |
name: Build linux/singularity container | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Set up Go 1.16 | |
uses: actions/setup-go@v1 | |
with: | |
go-version: 1.16 | |
id: go | |
- name: Install Dependencies | |
run: | | |
sudo apt-get update && sudo apt-get install -y \ | |
build-essential \ | |
libssl-dev \ | |
uuid-dev \ | |
libgpgme11-dev \ | |
squashfs-tools \ | |
libseccomp-dev \ | |
pkg-config \ | |
debootstrap \ | |
debian-keyring \ | |
debian-archive-keyring \ | |
rsync | |
- name: Install Singularity | |
env: | |
SINGULARITY_VERSION: 3.5.3 | |
GOPATH: /tmp/go | |
run: | | |
mkdir -p $GOPATH | |
sudo mkdir -p /usr/local/var/singularity/mnt | |
mkdir -p $GOPATH/src/github.com/sylabs | |
cd $GOPATH/src/github.com/sylabs | |
wget https://github.com/hpcng/singularity/releases/download/v${SINGULARITY_VERSION}/singularity-${SINGULARITY_VERSION}.tar.gz | |
tar -xzf singularity-${SINGULARITY_VERSION}.tar.gz | |
cd singularity | |
./mconfig -v -p /usr/local | |
make -j `nproc 2>/dev/null || echo 1` -C ./builddir all | |
sudo make -C ./builddir install | |
- name: Check out code for the container build | |
uses: actions/checkout@v3 | |
- name: Set release version if is a release | |
if: startsWith(github.event.ref, 'refs/tags/v') | |
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV | |
- name: Set release version if not a release | |
if: false == startsWith(github.event.ref, 'refs/tags/v') | |
run: echo "RELEASE_VERSION=test" >> $GITHUB_ENV | |
- name: Build Singularity container | |
env: | |
SINGULARITY_RECIPE: Singularity.def | |
OUTPUT_CONTAINER: mykrobe_${{env.RELEASE_VERSION}}.img | |
run: | | |
ls | |
if [ -f "${SINGULARITY_RECIPE}" ]; then | |
sudo -E singularity build ${OUTPUT_CONTAINER} ${SINGULARITY_RECIPE} | |
else | |
echo "${SINGULARITY_RECIPE} is not found." | |
echo "Present working directory: $PWD" | |
ls | |
fi | |
- name: Release | |
if: startsWith(github.event.ref, 'refs/tags/v') | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: mykrobe*.img | |
draft: true | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
mac_build: | |
name: Build mac os command line | |
runs-on: macos-11 | |
steps: | |
- name: Check out code for the build | |
uses: actions/checkout@v3 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: '3.8' | |
- name: Install dependencies | |
run: | | |
git clone -b v0.0.5 --recursive https://github.com/Mykrobe-tools/mccortex mccortex | |
cd mccortex | |
make MAXK=31 | |
cd .. | |
cp mccortex/bin/mccortex31 src/mykrobe/cortex/ | |
python -m pip install -r requirements.txt wheel pyinstaller | |
sudo python -m pip install . | |
- name: Set release version if is a release | |
if: startsWith(github.event.ref, 'refs/tags/v') | |
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV | |
- name: Set release version if not a release | |
if: false == startsWith(github.event.ref, 'refs/tags/v') | |
run: echo "RELEASE_VERSION=test" >> $GITHUB_ENV | |
- name: Test and build command line tarball | |
env: | |
OUTPUT_TARBALL: mykrobe.command_line.osx.${{env.RELEASE_VERSION}}.tar.gz | |
run: | | |
# mongod default data directory is /data/db, which is not writeable. | |
mkdir $HOME/mongodb_data | |
chown -R `id -un` $HOME/mongodb_data | |
sudo mongod --dbpath=$HOME/mongodb_data --quiet &> /dev/null & | |
sleep 3s | |
pytest --cov-report term-missing --cov=mykrobe | |
mykrobe panels update_metadata --panels_dir src/mykrobe/data | |
mykrobe panels update_species --panels_dir src/mykrobe/data --debug all | |
cd dist | |
pyinstaller --workpath='./pyinstaller_build/binary_cache' --distpath='./pyinstaller_build' mykrobe_atlas_pyinstaller.spec | |
cd pyinstaller_build | |
tar cvfz ../../${OUTPUT_TARBALL} mykrobe_atlas/ | |
- name: Release | |
if: startsWith(github.event.ref, 'refs/tags/v') | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: mykrobe.command_line.osx.*.tar.gz | |
draft: true | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
windows_build: | |
name: Build Windows command line | |
runs-on: windows-2019 | |
steps: | |
- uses: msys2/setup-msys2@v2 | |
with: | |
update: true | |
install: >- | |
autotools gcc git libcurl-devel bzip2 liblzma zip libbz2-devel xz zlib zlib-devel libtool wget liblzma-devel ncurses-devel base-devel openssl-devel mingw64/mingw-w64-x86_64-python3 mingw64/mingw-w64-x86_64-python3-pip mingw-w64-x86_64-python3-numpy mingw-w64-x86_64-python3-setuptools mingw-w64-x86_64-python3-wheel mingw-w64-x86_64-python-biopython | |
- name: Check out code for the build | |
uses: actions/checkout@v3 | |
- name: Set release version if is a release | |
if: startsWith(github.event.ref, 'refs/tags/v') | |
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV | |
shell: msys2 {0} | |
- name: Set release version if not a release | |
if: false == startsWith(github.event.ref, 'refs/tags/v') | |
run: echo "RELEASE_VERSION=test" >> $GITHUB_ENV | |
shell: msys2 {0} | |
- name: Start MongoDB service | |
run: | | |
sc.exe config MongoDB start= auto | |
sc.exe start MongoDB | |
- name: Test and build command line tarball | |
env: | |
OUTPUT_TARBALL: mykrobe.command_line.windows.${{env.RELEASE_VERSION}}.tar.gz | |
run: | | |
export PYTHONPATH="/mingw64/lib/python3.11/:/mingw64/lib/python3.11/site-packages:${PYTHONPATH}" | |
C:\\msys64\\mingw64\\bin\\python3.exe -m ensurepip --upgrade | |
C:\\msys64\\mingw64\\bin\\python3.exe -m pip install pyinstaller requests pytest | |
echo "clone mccortex" | |
rm -rf mccortex | |
git clone -b v0.0.5 --recursive https://github.com/Mykrobe-tools/mccortex mccortex | |
cd mccortex/libs/htslib | |
git checkout bcf9bff178f81c9c1cf3a052aeb6cbe32fe5fdcc | |
cd ../bcftools | |
git checkout b406a3906b153faa8bec0a53df07b2adf18a3052 | |
cd ../samtools | |
git checkout 2d4907cf9a34ccf7cde60143158b39e1cb40ac0c | |
cd ../../../ | |
python ./ci/windows_file_fixes.py | |
cd mccortex | |
echo "make mccortex" | |
make all | |
echo "make tests mccortex" | |
make tests | |
cd .. | |
echo "pip install requirements" | |
C:\\msys64\\mingw64\\bin\\python3.exe -m pip install -r requirements.txt | |
echo "pip install ." | |
C:\\msys64\\mingw64\\bin\\python3.exe -m pip install . | |
echo "pytest" | |
export MYKROBE_MCCORTEX="${PWD}/mccortex/bin/mccortex31" | |
C:\\msys64\\mingw64\\bin\\python3.exe -m pytest | |
echo "update panels" | |
C:\\msys64/mingw64/bin/mykrobe.exe panels update_metadata --panels_dir src/mykrobe/data | |
C:\\msys64/mingw64/bin/mykrobe.exe panels update_species --panels_dir src/mykrobe/data --debug all | |
cd dist | |
C:\\msys64/mingw64/bin/pyinstaller.exe --workpath='./pyinstaller_build/binary_cache' --distpath='./pyinstaller_build' mykrobe_atlas_pyinstaller_windows.spec | |
cd pyinstaller_build | |
tar cvfz ../../${OUTPUT_TARBALL} mykrobe_atlas/ | |
shell: msys2 {0} | |
- name: Release | |
if: startsWith(github.event.ref, 'refs/tags/v') | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: mykrobe.command_line.windows.*.tar.gz | |
draft: true | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |