From 33093f54d720fcfb9f7f04fbb95831a2ee414010 Mon Sep 17 00:00:00 2001 From: Till Sauerwein Date: Mon, 9 Oct 2023 13:54:54 +0200 Subject: [PATCH] Update main.yml to run tests for python 3.8 3.9. 3.10 --- .github/workflows/main.yml | 172 +++++++++++++++++++++++++++++-------- 1 file changed, 136 insertions(+), 36 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 682fd8e..c62920a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -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: @@ -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 @@ -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 @@ -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