Skip to content

Merge pull request #136 from VisLab/develop #303

Merge pull request #136 from VisLab/develop

Merge pull request #136 from VisLab/develop #303

Workflow file for this run

name: CI
on:
push:
branches: ["*"]
pull_request:
branches: ["*"]
env:
BRANCH_NAME: ${{ github.event.pull_request.base.ref || github.ref_name }}
jobs:
build:
strategy:
matrix:
platform: [ubuntu-latest]
python-version: [3.9]
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- uses: actions/cache@v3
with:
path: ${{ env.pythonLocation }}
key: ${{ env.pythonLocation }}-${{ hashFiles('setup.py') }}-${{ hashFiles('dev-requirements.txt') }}-${{ env.BRANCH_NAME == 'stable' }}
- name: Install dependencies(using master hed-python)
if: ${{ env.BRANCH_NAME == 'master' }}
run: |
python -m pip install --upgrade pip
pip install flake8
pip install coverage
pip install git+https://github.com/hed-standard/hed-python/@${{env.BRANCH_NAME}}
pip install -r requirements.txt
pip install -r docs/requirements.txt
- name: Install dependencies(using develop hed-python)
if: ${{ env.BRANCH_NAME != 'stable' || env.BRANCH_NAME != 'master' }}
run: |
python -m pip install --upgrade pip
pip install flake8
pip install coverage
pip install git+https://github.com/hed-standard/hed-python/@develop
pip install -r requirements.txt
pip install -r docs/requirements.txt
- name: Install dependencies(using pip)
if: ${{ env.BRANCH_NAME == 'stable'}}
run: |
python -m pip install --upgrade pip
pip install flake8
pip install coverage
pip install hedtools
pip install -r requirements.txt
pip install -r docs/requirements.txt
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --show-source --statistics --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with unittest
run: |
cp -f ./config_template.py ./config.py
coverage run -m unittest
- name: publish-coverages
if: ${{ env.BRANCH_NAME == 'develop' || env.BRANCH_NAME == 'master' }}
continue-on-error: true
with:
coverageCommand: coverage xml
debug: true
uses: paambaati/codeclimate-action@v3.2.0
env:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID_WEB }}