|
| 1 | +name: Python Package using Conda |
| 2 | + |
| 3 | +on: [push] |
| 4 | + |
| 5 | +jobs: |
| 6 | + build-linux: |
| 7 | + runs-on: ubuntu-latest |
| 8 | + strategy: |
| 9 | + max-parallel: 5 |
| 10 | + |
| 11 | + steps: |
| 12 | + - uses: actions/checkout@v4 |
| 13 | + - name: Set up Python 3.10 |
| 14 | + uses: actions/setup-python@v3 |
| 15 | + with: |
| 16 | + python-version: '3.10' |
| 17 | + - name: Add conda to system path |
| 18 | + run: | |
| 19 | + # $CONDA is an environment variable pointing to the root of the miniconda directory |
| 20 | + echo $CONDA/bin >> $GITHUB_PATH |
| 21 | + - name: Install dependencies |
| 22 | + run: | |
| 23 | + conda env update --file environment.yml --name base |
| 24 | + - name: Lint with flake8 |
| 25 | + run: | |
| 26 | + conda install flake8 |
| 27 | + # stop the build if there are Python syntax errors or undefined names |
| 28 | + flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics |
| 29 | + # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide |
| 30 | + flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics |
| 31 | + - name: Test with pytest |
| 32 | + run: | |
| 33 | + conda install pytest |
| 34 | + pytest |
| 35 | +name: Pylint |
| 36 | + |
| 37 | +on: [push] |
| 38 | + |
| 39 | +jobs: |
| 40 | + build: |
| 41 | + runs-on: ubuntu-latest |
| 42 | + strategy: |
| 43 | + matrix: |
| 44 | + python-version: ["3.8", "3.9", "3.10"] |
| 45 | + steps: |
| 46 | + - uses: actions/checkout@v4 |
| 47 | + - name: Set up Python ${{ matrix.python-version }} |
| 48 | + uses: actions/setup-python@v3 |
| 49 | + with: |
| 50 | + python-version: ${{ matrix.python-version }} |
| 51 | + - name: Install dependencies |
| 52 | + run: | |
| 53 | + python -m pip install --upgrade pip |
| 54 | + pip install pylint |
| 55 | + - name: Analysing the code with pylint |
| 56 | + run: | |
| 57 | + pylint $(git ls-files 'to 5242 |
| 58 | +the 5205 |
| 59 | +and 4897 |
| 60 | +of 4295 |
| 61 | +i 3191 |
| 62 | +a 3130 |
| 63 | +it 2529 |
| 64 | +her 2483 |
| 65 | +was 2400 |
| 66 | +she 2364.py') |
0 commit comments