From 535ece177a8e326d91517b698f635d905f37f028 Mon Sep 17 00:00:00 2001 From: psilo909 Date: Tue, 10 May 2022 18:53:13 +0200 Subject: [PATCH 1/4] Create unittests.yml --- .github/workflows/unittests.yml | 55 +++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 .github/workflows/unittests.yml diff --git a/.github/workflows/unittests.yml b/.github/workflows/unittests.yml new file mode 100644 index 000000000..e7f1de3fd --- /dev/null +++ b/.github/workflows/unittests.yml @@ -0,0 +1,55 @@ +name: "SmartHomeNG Unittest Workflow Core" +on: [workflow_dispatch, push] +#on: +# workflow_dispatch: +# push: +env: + DEP_PATH: smarthomeng/requirements/all.txt +jobs: + build: + runs-on: ubuntu-20.04 #latest + strategy: + fail-fast: false + matrix: + 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: Checkout SmartHomeNG DEVELOP Branch + # uses: actions/checkout@v2 + # with: + # repository: smarthomeNG/smarthome + # ref: develop + # path: smarthomeng + - name: Checkout SmartHomeNG/plugins DEVELOP Branch + uses: actions/checkout@v2 + with: + repository: smarthomeNG/plugins + ref: develop + path: smarthomeng/plugins + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + architecture: x64 + - name: Print Python Version + run: python --version + - run: python3 -m pip install --upgrade pip #==19.3.1 + #- run: pip install tox-travis virtualenv>=20.0.8 --upgrade + - run: pip install sphinx sphinx_rtd_theme recommonmark ruamel.yaml pytest + - name: Build Requirements + run: python3 smarthomeng/tools/build_requirements.py + - name: Show requirements/base.txt + run: head smarthomeng/requirements/base.txt -n 12 + - name: Show requirements/all.txt + run: head smarthomeng/requirements/all.txt -n 12 + - name: Install base.txt + run: pip install -r smarthomeng/requirements/base.txt + - name: Run Python Unittests + working-directory: ./smarthomeng/plugins + run: pytest From 4be5606a2449aa7a1eda0a16652bf8a0094c585e Mon Sep 17 00:00:00 2001 From: psilo909 Date: Tue, 10 May 2022 18:55:14 +0200 Subject: [PATCH 2/4] Delete unittests.yml delete accidentially created action --- .github/workflows/unittests.yml | 55 --------------------------------- 1 file changed, 55 deletions(-) delete mode 100644 .github/workflows/unittests.yml diff --git a/.github/workflows/unittests.yml b/.github/workflows/unittests.yml deleted file mode 100644 index e7f1de3fd..000000000 --- a/.github/workflows/unittests.yml +++ /dev/null @@ -1,55 +0,0 @@ -name: "SmartHomeNG Unittest Workflow Core" -on: [workflow_dispatch, push] -#on: -# workflow_dispatch: -# push: -env: - DEP_PATH: smarthomeng/requirements/all.txt -jobs: - build: - runs-on: ubuntu-20.04 #latest - strategy: - fail-fast: false - matrix: - 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: Checkout SmartHomeNG DEVELOP Branch - # uses: actions/checkout@v2 - # with: - # repository: smarthomeNG/smarthome - # ref: develop - # path: smarthomeng - - name: Checkout SmartHomeNG/plugins DEVELOP Branch - uses: actions/checkout@v2 - with: - repository: smarthomeNG/plugins - ref: develop - path: smarthomeng/plugins - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python-version }} - architecture: x64 - - name: Print Python Version - run: python --version - - run: python3 -m pip install --upgrade pip #==19.3.1 - #- run: pip install tox-travis virtualenv>=20.0.8 --upgrade - - run: pip install sphinx sphinx_rtd_theme recommonmark ruamel.yaml pytest - - name: Build Requirements - run: python3 smarthomeng/tools/build_requirements.py - - name: Show requirements/base.txt - run: head smarthomeng/requirements/base.txt -n 12 - - name: Show requirements/all.txt - run: head smarthomeng/requirements/all.txt -n 12 - - name: Install base.txt - run: pip install -r smarthomeng/requirements/base.txt - - name: Run Python Unittests - working-directory: ./smarthomeng/plugins - run: pytest From f2964df5a0f9ede82f4c39cd4dd602d7b1afc7cc Mon Sep 17 00:00:00 2001 From: msinn Date: Mon, 16 May 2022 20:14:32 +0200 Subject: [PATCH 3/4] Create unittests.yml --- .github/workflows/unittests.yml | 67 +++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 .github/workflows/unittests.yml diff --git a/.github/workflows/unittests.yml b/.github/workflows/unittests.yml new file mode 100644 index 000000000..ca5d25c35 --- /dev/null +++ b/.github/workflows/unittests.yml @@ -0,0 +1,67 @@ +name: "Unittests Plugins" +#on: [workflow_dispatch, push] +on: + workflow_dispatch: + push: + branches: + - '*' + - '!release_doc' + +jobs: + build: + runs-on: ubuntu-20.04 #latest + strategy: + fail-fast: false + matrix: + python-version: [ '3.7', '3.8', '3.9', '3.10' ] + name: Python ${{ matrix.python-version }} + steps: + - 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: 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: ${{steps.extract_branch.outputs.branch}} + - name: Checkout plugins from ${{steps.extract_branch.outputs.branch}} branch + uses: actions/checkout@v3 + with: + repository: smarthomeNG/plugins + ref: ${{steps.extract_branch.outputs.branch}} + path: plugins + + - name: Set up Python + uses: actions/setup-python@v3 + with: + python-version: ${{ matrix.python-version }} + architecture: x64 + - run: python3 -m pip install --upgrade pip + + - name: Install requirements for unit testing + run: pip install -r tests/requirements.txt + - name: Build Requirements for SmartHomeNG + run: python3 tools/build_requirements.py + - name: Install SmartHomeNG base requirements + # base requirements are needed for pytest to run + run: pip install -r requirements/base.txt + + # --- up to here, the workflow is identical for CORE and PLUGINS --- + + - name: Install SmartHomeNG all requirements + # all requirements are needed for pytest to run plugin tests + run: pip install -r requirements/all.txt + + - name: '>>> Run Python Unittests for PLUGINS <<<' + working-directory: ./plugins + run: pytest From e9f4b86983b08e1d81c37d13dadc52538d92cbd0 Mon Sep 17 00:00:00 2001 From: msinn Date: Mon, 16 May 2022 20:22:11 +0200 Subject: [PATCH 4/4] Delete unittests.yml --- .github/workflows/unittests.yml | 67 --------------------------------- 1 file changed, 67 deletions(-) delete mode 100644 .github/workflows/unittests.yml diff --git a/.github/workflows/unittests.yml b/.github/workflows/unittests.yml deleted file mode 100644 index ca5d25c35..000000000 --- a/.github/workflows/unittests.yml +++ /dev/null @@ -1,67 +0,0 @@ -name: "Unittests Plugins" -#on: [workflow_dispatch, push] -on: - workflow_dispatch: - push: - branches: - - '*' - - '!release_doc' - -jobs: - build: - runs-on: ubuntu-20.04 #latest - strategy: - fail-fast: false - matrix: - python-version: [ '3.7', '3.8', '3.9', '3.10' ] - name: Python ${{ matrix.python-version }} - steps: - - 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: 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: ${{steps.extract_branch.outputs.branch}} - - name: Checkout plugins from ${{steps.extract_branch.outputs.branch}} branch - uses: actions/checkout@v3 - with: - repository: smarthomeNG/plugins - ref: ${{steps.extract_branch.outputs.branch}} - path: plugins - - - name: Set up Python - uses: actions/setup-python@v3 - with: - python-version: ${{ matrix.python-version }} - architecture: x64 - - run: python3 -m pip install --upgrade pip - - - name: Install requirements for unit testing - run: pip install -r tests/requirements.txt - - name: Build Requirements for SmartHomeNG - run: python3 tools/build_requirements.py - - name: Install SmartHomeNG base requirements - # base requirements are needed for pytest to run - run: pip install -r requirements/base.txt - - # --- up to here, the workflow is identical for CORE and PLUGINS --- - - - name: Install SmartHomeNG all requirements - # all requirements are needed for pytest to run plugin tests - run: pip install -r requirements/all.txt - - - name: '>>> Run Python Unittests for PLUGINS <<<' - working-directory: ./plugins - run: pytest