Skip to content

Commit

Permalink
workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
yozik04 committed Jan 14, 2024
1 parent 22b41d4 commit 588d03f
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 8 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
Expand All @@ -54,7 +54,7 @@ jobs:
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v2
uses: github/codeql-action/autobuild@v3

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
Expand All @@ -68,4 +68,4 @@ jobs:
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
uses: github/codeql-action/analyze@v3
33 changes: 33 additions & 0 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Coverage

on:
push:
branches: [ master ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ master ]

jobs:
build:

runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.11"]

steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pytest pytest-cov pytest-asyncio
- name: Coverage
run: |
python -m pip install .
pytest tests/ --cov=nibe --cov-report=xml
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
8 changes: 6 additions & 2 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,12 @@ jobs:
needs: test
steps:
- uses: actions/checkout@v4
- name: Check versions match
run: |
PUBLISHING_VERSION=${{ github.event.release.tag_name }}
grep -qE '__version__ = "'$PUBLISHING_VERSION'"' vallox_websocket_api/__init__.py
- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Install dependencies
Expand All @@ -32,7 +36,7 @@ jobs:
- name: Build package
run: python -m build
- name: Publish package
uses: pypa/gh-action-pypi-publish@b7f401de30cb6434a1e19f805ff006643653240e
uses: pypa/gh-action-pypi-publish@release/v1.5
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
9 changes: 6 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,11 @@ name: Test and Lint
on:
workflow_call:
workflow_dispatch:
pull_request:
push:
branches: [ master ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ master ]

jobs:
build:
Expand All @@ -21,12 +24,12 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install flake8 tox
python -m pip install --upgrade flake8 tox
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
Expand Down

0 comments on commit 588d03f

Please sign in to comment.