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 48d4b7a commit 4e6cd1d
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions .github/workflows/linting_and_testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,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 @@ -57,15 +59,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 @@ -80,7 +82,7 @@ jobs:
flake8 . --exclude=docs --ignore=C901,E226 --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 @@ -91,7 +93,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 @@ -103,12 +105,12 @@ jobs:
pytest biobb_godmd/test/unitests/ --cov=biobb_godmd/ --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 Down

0 comments on commit 4e6cd1d

Please sign in to comment.