Skip to content

README.md - Updated #19

README.md - Updated

README.md - Updated #19

name: preliminary-ci-test-with-mambaforge
on:
push:
branches: [ dev ]
env:
CACHE_NUMBER: 1 # increase to reset cache manually
jobs:
build-linux:
strategy:
matrix:
include:
- os: ubuntu-latest
label: linux-64
prefix: /usr/share/miniconda3/envs/my-env
python-version: '3.11'
- os: ubuntu-latest
label: linux-64b
prefix: /usr/share/miniconda3/envs/my-env
python-version: '3.10'
name: ${{ matrix.label }}
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- name: Setup Mambaforge
uses: conda-incubator/setup-miniconda@v2
with:
miniforge-variant: Mambaforge
miniforge-version: latest
activate-environment: my-env
use-mamba: true
python-version: ${{ matrix.python-version }}
- name: Set cache date
run: echo "DATE=$(date +'%Y%m%d')" >> $GITHUB_ENV
- uses: actions/cache@v2
with:
path: ${{ matrix.prefix }}
key: ${{ matrix.label }}-conda-${{ hashFiles('environment.yaml') }}-${{ env.DATE }}-${{ env.CACHE_NUMBER }}
id: cache
- name: Update environment
run: mamba env update -n my-env -f environment.yaml
if: steps.cache.outputs.cache-hit != 'true'
- name: Install Other Dependencies with PIP
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=127 --statistics
- name: Run Unit test with pytest
shell: bash -l {0}
run: |
python -m pytest --import-mode=append test/