Skip to content

Commit

Permalink
[CI/CD](linting_and_testing.yml): Update set-up micromamba.
Browse files Browse the repository at this point in the history
  • Loading branch information
PauAndrio committed Nov 4, 2024
1 parent eeab5a0 commit 96025f9
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions .github/workflows/linting_and_testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -122,7 +124,6 @@ jobs:
with:
folder: ./reports

# - name: Restore .bash_profile
# run: cp ~/.bash_profile_orig ~/.bash_profile



0 comments on commit 96025f9

Please sign in to comment.