Skip to content

test(ci): Add github action for tests #12

test(ci): Add github action for tests

test(ci): Add github action for tests #12

name: Continuous Integration
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build-and-test:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.11
cache: 'pip'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r appdaemon/test/requirements.txt
- name: Lint code with pylint
continue-on-error: true
run: |
pylint $(git ls-files '*.py')
- name: Run coverage analysis
continue-on-error: true
run: |
cd appdaemon/test
coverage run --source apps -m pytest test
coverage report -m
- name: Test with pytest
run: |
cd appdaemon/test
pytest -v