Skip to content

Commit

Permalink
Update main.yml to run tests for python 3.8 3.9. 3.10
Browse files Browse the repository at this point in the history
  • Loading branch information
Tillsa committed Oct 9, 2023
1 parent c887ee4 commit 33093f5
Showing 1 changed file with 136 additions and 36 deletions.
172 changes: 136 additions & 36 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# This workflow will install Python dependencies, run tests with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: Python package build

on:
Expand All @@ -11,45 +8,95 @@ on:
workflow_dispatch:
branches: [ main ]


jobs:
build:

test_python_3_10:
name: Test Python 3.10
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: [3.7, 3.8, 3.9]

# steps:
# - uses: actions/checkout@v2
# - uses: conda-incubator/setup-miniconda@v2
# with:
# python-version: 3.9
# - name: Set up Python ${{ matrix.python-version }}
# uses: actions/setup-python@v2
# with:
# python-version: ${{ matrix.python-version }}

steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
python-version: "3.10"
- uses: s-weigand/setup-conda@v1
with:
activate-conda: false
python-version: "3.10"
activate-conda: true
- run: conda --version
- run: which python
- name: Show working dir
shell: bash
run: ls
- name: Add reademption bin to PATH
shell: bash
run: echo "bin" >> $GITHUB_PATH
- name: Conda info
shell: bash
run: conda info
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install flake8 pytest
python -m pip install matplotlib
python -m pip install biopython
python -m pip install pysam
python -m pip install pandas
python -m pip install seaborn
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Update
shell: bash
run: sudo apt-get update
- name: Install packages
shell: bash
run: sudo apt-get install -y python3 python3-setuptools python3-pip cython3 zlib1g-dev make libncurses5-dev libxml2-dev libcurl4-openssl-dev r-base
- name: Conda info
shell: bash
run: conda info
- name: Conda install segemehl
shell: bash
run: conda install -c bioconda segemehl=0.3.4
- name: Conda list
shell: bash
run: conda list
- name: List conda bin
run: ls $CONDA/bin
- name: Add conda bin (segemehl.x) to PATH
shell: bash
run: echo "$CONDA/bin" >> $GITHUB_PATH
- name: Install DESEQ2
shell: bash
run: sudo echo "if (!requireNamespace('BiocManager', quietly = TRUE)) install.packages('BiocManager') ; BiocManager::install('DESeq2'); install.packages('gplots')" | sudo R --no-save
- name: Show python version
shell: bash
run: python --version
- name: Test with pytest
run: |
pytest

test_python_3_9:
name: Test Python 3.9
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.9
uses: actions/setup-python@v4
with:
python-version: 3.9
- uses: s-weigand/setup-conda@v1
with:
python-version: 3.9
activate-conda: true
- run: conda --version
- run: which python
- name: Show working dir
shell: bash
run: ls
- name: Add reademption bin to PATH
shell: bash
run: echo "bin" >> $GITHUB_PATH
- name: Conda info
shell: bash
run: conda info
- name: Install dependencies
run: |
python -m pip install --upgrade pip
Expand All @@ -66,21 +113,71 @@ jobs:
- name: Install packages
shell: bash
run: sudo apt-get install -y python3 python3-setuptools python3-pip cython3 zlib1g-dev make libncurses5-dev libxml2-dev libcurl4-openssl-dev r-base
- name: create conda env for python 3.9
- name: Conda info
shell: bash
run: conda info
- name: Conda install segemehl
shell: bash
run: conda install -c bioconda segemehl=0.3.4
- name: Conda list
shell: bash
run: conda list
- name: List conda bin
run: ls $CONDA/bin
- name: Add conda bin (segemehl.x) to PATH
shell: bash
run: echo "$CONDA/bin" >> $GITHUB_PATH
- name: Install DESEQ2
shell: bash
run: sudo echo "if (!requireNamespace('BiocManager', quietly = TRUE)) install.packages('BiocManager') ; BiocManager::install('DESeq2'); install.packages('gplots')" | sudo R --no-save
- name: Show python version
shell: bash
run: python --version
- name: Test with pytest
run: |
pytest
test_python_3_8:
name: Test Python 3.8
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.8
uses: actions/setup-python@v4
with:
python-version: 3.8
- uses: s-weigand/setup-conda@v1
with:
python-version: 3.8
activate-conda: true
- run: conda --version
- run: which python
- name: Show working dir
shell: bash
run: conda create -n myenv python=3.9
- name: init bash
run: ls
- name: Add reademption bin to PATH
shell: bash
run: conda init bash
- name: source bash
run: echo "bin" >> $GITHUB_PATH
- name: Conda info
shell: bash
#run: exec bash
run: source /home/runner/.bashrc
- name: activate conda env
run: conda info
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install flake8 pytest
python -m pip install matplotlib
python -m pip install biopython
python -m pip install pysam
python -m pip install pandas
python -m pip install seaborn
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Update
shell: bash
# run: conda activate myenv
run: source activate myenv

run: sudo apt-get update
- name: Install packages
shell: bash
run: sudo apt-get install -y python3 python3-setuptools python3-pip cython3 zlib1g-dev make libncurses5-dev libxml2-dev libcurl4-openssl-dev r-base
- name: Conda info
shell: bash
run: conda info
Expand All @@ -98,6 +195,9 @@ jobs:
- name: Install DESEQ2
shell: bash
run: sudo echo "if (!requireNamespace('BiocManager', quietly = TRUE)) install.packages('BiocManager') ; BiocManager::install('DESeq2'); install.packages('gplots')" | sudo R --no-save
- name: Show python version
shell: bash
run: python --version
- name: Test with pytest
run: |
pytest

0 comments on commit 33093f5

Please sign in to comment.