Skip to content

Commit

Permalink
workflows: Copied and adopted streamlined unittests workflow from core
Browse files Browse the repository at this point in the history
  • Loading branch information
msinn committed May 16, 2022
1 parent 768436a commit 49bdfe8
Showing 1 changed file with 27 additions and 21 deletions.
48 changes: 27 additions & 21 deletions .github/workflows/unittests.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: "Unittest Workflow Plugins"
name: "Unittests Plugins"
#on: [workflow_dispatch, push]
on:
workflow_dispatch:
Expand All @@ -16,40 +16,45 @@ jobs:
python-version: [ '3.7', '3.8', '3.9', '3.10' ]
name: Python ${{ matrix.python-version }}
steps:
- name: update OS (Ubuntu)
run: sudo apt-get update
- run: sudo apt-get install libudev-dev
- run: sudo apt-get install librrd-dev libpython3-dev
- run: sudo apt-get install gcc --only-upgrade
- uses: actions/checkout@v2
- name: Setup OS (Ubuntu)
run: |
sudo apt-get update
sudo apt-get install libudev-dev
sudo apt-get install librrd-dev libpython3-dev
sudo apt-get install gcc --only-upgrade
- name: Checkout SmartHomeNG CORE DEVELOP Branch
uses: actions/checkout@v2
- name: Get branch name
run: |
echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
echo ${GITHUB_REF#refs/heads/}
id: extract_branch

- name: Checkout core from ${{steps.extract_branch.outputs.branch}} branch
uses: actions/checkout@v3
with:
repository: smarthomeNG/smarthome
ref: develop
path: smarthomeng
- name: Checkout SmartHomeNG plugins DEVELOP Branch
uses: actions/checkout@v2
ref: ${{steps.extract_branch.outputs.branch}}
- name: Checkout plugins from ${{steps.extract_branch.outputs.branch}} branch
uses: actions/checkout@v3
with:
repository: smarthomeNG/plugins
ref: develop
path: smarthomeng/plugins
ref: ${{steps.extract_branch.outputs.branch}}
path: plugins

- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
architecture: x64
- run: python3 -m pip install --upgrade pip #==19.3.1
- run: python3 -m pip install --upgrade pip

- name: Install requirements for unit testing
run: pip install -r smarthomeng/tests/requirements.txt
run: pip install -r tests/requirements.txt
- name: Build Requirements for SmartHomeNG
run: python3 smarthomeng/tools/build_requirements.py
run: python3 tools/build_requirements.py
- name: Install SmartHomeNG base requirements
# base requirements are needed for pytest to run
run: pip install -r smarthomeng/requirements/base.txt
run: pip install -r requirements/base.txt

# --- up to here, the workflow is identical for CORE and PLUGINS ---

Expand All @@ -59,6 +64,7 @@ jobs:

#- name: Install Database Plugin Requirements
# run: pip install -r smarthomeng/plugins/database/requirements.txt
- name: '>>> Run Python Unittests for PLUGINS <<<'
- name: Run Python Unittests for PLUGINS
working-directory: ./smarthomeng/plugins
working-directory: ./plugins
run: pytest

0 comments on commit 49bdfe8

Please sign in to comment.