Skip to content

Update python version and micromamba usage in CI #12

Update python version and micromamba usage in CI

Update python version and micromamba usage in CI #12

Workflow file for this run

name: CI
on:
push:
branches: [ main ]
jobs:
lint:
name: lint and style checks
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.11
uses: actions/setup-python@v3
with:
python-version: '3.11'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=79 --statistics
build-linux:
runs-on: ubuntu-latest
needs: [lint]
defaults:
run:
shell: bash -l {0}
strategy:
matrix:
python-version: ['3.11']
steps:
- uses: actions/checkout@v3
- name: Install micromamba environment
uses: mamba-org/setup-micromamba@v1
with:
environment-name: pylawr-tests
environment-file: environment.yml
extra-specs: |
python=${{ matrix.python-version }}
- name: Install pylawr
run: |
pip install .
- name: Test with unittest
run: |
python -m coverage run --source=pylawr -m unittest
python -m coverage report
python -m coverage xml -o ./coverage.xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v2
with:
fail_ci_if_error: false
files: ./coverage.xml
flags: unittests