From 96025f9cc34c832a5b8d5b59eddf79f1bff8aed1 Mon Sep 17 00:00:00 2001 From: Pau Andrio Date: Mon, 4 Nov 2024 10:35:02 +0100 Subject: [PATCH] [CI/CD](linting_and_testing.yml): Update set-up micromamba. --- .github/workflows/linting_and_testing.yml | 25 ++++++++++++----------- 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/.github/workflows/linting_and_testing.yml b/.github/workflows/linting_and_testing.yml index b113557..22740fa 100644 --- a/.github/workflows/linting_and_testing.yml +++ b/.github/workflows/linting_and_testing.yml @@ -41,11 +41,13 @@ jobs: rm -rf /home/user/.bash_profile /home/user/.conda /home/user/micromamba /home/user/micromamba-bin 2>/dev/null touch /home/user/.bash_profile - - name: provision-with-micromamba - uses: mamba-org/setup-micromamba@v1 + - name: setup-micromamba + uses: mamba-org/setup-micromamba@v2.0.0 with: generate-run-shell: true - post-cleanup: all + micromamba-version: '2.0.2-2' + post-cleanup: 'all' + init-shell: bash environment-file: .github/env.yaml create-args: >- python=${{ matrix.python-version }} @@ -56,15 +58,15 @@ jobs: pip - name: Install genbadge from pip - shell: micromamba-shell {0} # necessary for conda env to be active + shell: bash -l {0} run: pip install genbadge[all] - name: List installed package versions - shell: micromamba-shell {0} # necessary for conda env to be active + shell: bash -l {0} run: micromamba list - name: Lint with flake8 - shell: micromamba-shell {0} # necessary for conda env to be active + shell: bash -l {0} run: | # F Codes: https://flake8.pycqa.org/en/latest/user/error-codes.html # E Code: https://pycodestyle.pycqa.org/en/latest/intro.html#error-codes @@ -79,7 +81,7 @@ jobs: flake8 . --exclude=docs --ignore=C901,E226,W605 --count --exit-zero --max-complexity=10 --max-line-length=9999 --statistics --format=html --htmldir=./reports/flake8/ --tee --output-file=./reports/flake8/flake8stats.txt - name: Generate Flake8 badge - shell: micromamba-shell {0} # necessary for conda env to be active + shell: bash -l {0} run: | genbadge flake8 --name "Flake8" --input-file ./reports/flake8/flake8stats.txt --output-file ./reports/flake8/flake8badge.svg @@ -90,7 +92,7 @@ jobs: path: './biobb_common' - name: Run tests - shell: micromamba-shell {0} # necessary for conda env to be active + shell: bash -l {0} run: | # Ignoring docker and singularity tests export PYTHONPATH=.:./biobb_common:$PYTHONPATH @@ -102,12 +104,12 @@ jobs: pytest biobb_analysis/test/unitests/ --cov=biobb_analysis/ --cov-report=xml --ignore-glob=*container.py --ignore-glob=*docker.py --ignore-glob=*singularity.py --junit-xml=./reports/junit/junit.xml --html=./reports/junit/report.html - name: Generate Tests badge - shell: micromamba-shell {0} # necessary for conda env to be active + shell: bash -l {0} run: | genbadge tests --name "Tests" --input-file ./reports/junit/junit.xml --output-file ./reports/junit/testsbadge.svg - name: Generate Coverage badge - shell: micromamba-shell {0} # necessary for conda env to be active + shell: bash -l {0} run: | # Create directory for flake8 reports mkdir -p ./reports/coverage @@ -122,7 +124,6 @@ jobs: with: folder: ./reports - # - name: Restore .bash_profile - # run: cp ~/.bash_profile_orig ~/.bash_profile +