Adding new IF czi workflow #359
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: Python Test and Package | |
on: | |
push: | |
branches: | |
- main | |
tags: | |
- "v*" | |
pull_request: | |
branches: | |
- main | |
env: | |
HEDWIG_ENV: dev | |
jobs: | |
docs: | |
runs-on: ubuntu-latest | |
needs: test | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- name: Set up Python 3.8 | |
uses: actions/setup-python@v2 | |
with: | |
python-version: 3.8 | |
- name: Install dependencies | |
run: | | |
python -m pip install -r docs/requirements.txt | |
- name: Build Sphinx Documentation | |
run: | | |
make -C docs html | |
- name: Upload documentation | |
if: github.event_name == 'push' | |
uses: actions/upload-artifact@v1 | |
with: | |
name: sphinx-docs | |
path: docs/_build/html | |
- name: Update gh-pages | |
if: github.ref == 'refs/heads/main' | |
run: | | |
rm docs/_build/html/.buildinfo | |
touch docs/_build/html/.nojekyll | |
git update-ref refs/heads/${TARGET_BRANCH} origin/${TARGET_BRANCH} | |
./.github/workflows/update-gh-pages.sh docs/_build/html | |
repo_uri="https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git" | |
git push $repo_uri ${TARGET_BRANCH} | |
env: | |
GITHUB_TOKEN: ${{ secrets.github_token }} | |
TARGET_BRANCH: "gh-pages" | |
test: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: ["3.8"] | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- uses: actions/setup-java@v3 | |
with: | |
distribution: 'zulu' | |
java-version: '17' | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: 3.8 | |
- name: Create LFS file list | |
run: | | |
git lfs ls-files -l | cut -d' ' -f1 | sort > .lfs-assets-id | |
- name: Restore LFS cache | |
uses: actions/cache@v2 | |
id: lfs-cache | |
with: | |
path: .git/lfs | |
key: lfs-v1-${{ hashFiles('.lfs-assets-id') }} | |
restore-keys: lfs-v1- | |
- name: Git LFS Pull | |
run: | | |
git lfs pull | |
# - name: IMOD Container Build | |
# id: docker-build-imod | |
# env: | |
# DOCKERFILE_PATH: utils/imod/ | |
# run: | | |
# docker build -t imod $DOCKERFILE_PATH | |
# - name: IMOD Container Test | |
# run: | | |
# docker run imod dm2mrc -h | |
# - name: Graphicsmagick Container Build | |
# id: docker-build-graphicsmagick | |
# env: | |
# DOCKERFILE_PATH: utils/graphicsmagick/ | |
# run: | | |
# docker build -t graphicsmagick $DOCKERFILE_PATH | |
# - name: Graphicsmagick Container Test | |
# run: | | |
# docker run graphicsmagick gm -version | |
# - name: Set up Python ${{ matrix.python-version }} | |
# uses: actions/setup-python@v2 | |
# with: | |
# python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: | | |
IMOD=imod_4.11.24_RHEL7-64_CUDA10.1.sh | |
export IMOD_DIR=/usr/local/IMOD | |
export PATH=$IMOD_DIR/bin:$PATH | |
wget https://bio3d.colorado.edu/imod/AMD64-RHEL5/${IMOD} && sudo sh ${IMOD} -yes && rm -f ${IMOD} | |
BIO2R_V=0.7.0 | |
BIO2R_Z=bioformats2raw-${BIO2R_V}.zip | |
export BIO2R_DIR=/usr/local/BIO2R | |
export PATH=$BIO2R_DIR/bioformats2raw-${BIO2R_V}/bin:$PATH | |
wget https://github.com/glencoesoftware/bioformats2raw/releases/download/v${BIO2R_V}/${BIO2R_Z} && sudo unzip ${BIO2R_Z} -d ${BIO2R_DIR} && rm -f ${BIO2R_Z} | |
python -m pip install --upgrade pip | |
pip install -e . -r requirements.txt | |
sudo apt -y update && sudo apt -y install libgl-dev graphicsmagick libblosc1 | |
- name: Test Coverage | |
continue-on-error: true | |
run: | | |
BIO2R_V=0.7.0 | |
export BIO2R_DIR=/usr/local/BIO2R/bioformats2raw-${BIO2R_V} | |
export IMOD_DIR=/usr/local/IMOD | |
export PATH=$BIO2R_DIR/bin:$IMOD_DIR/bin:$PATH | |
python -m pytest -v --log-cli-level=INFO -m "not (slow or localdata)" --cov-report term --cov=. | |
- name: Coverage Badge | |
uses: tj-actions/coverage-badge-py@v2 |