-
Notifications
You must be signed in to change notification settings - Fork 86
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #371 from moralmunky/0.3.0
0.3.0 - Release
- Loading branch information
Showing
51 changed files
with
28,198 additions
and
1,583 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[report] | ||
show_missing = True | ||
fail_under = 95 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
codecov: | ||
require_ci_to_pass: yes | ||
|
||
coverage: | ||
precision: 2 | ||
round: down | ||
range: "70...100" | ||
|
||
parsers: | ||
gcov: | ||
branch_detection: | ||
conditional: yes | ||
loop: yes | ||
method: no | ||
macro: no | ||
|
||
comment: | ||
layout: "reach,diff,flags,tree" | ||
behavior: default | ||
require_changes: no | ||
|
||
ignore: | ||
- "tests/" # no need to test the tests | ||
- "test.py" # doesn't need testing |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,112 @@ | ||
name: Validate with hassfest | ||
name: "Validation and Formatting" | ||
|
||
on: | ||
push: | ||
pull_request: ~ | ||
pull_request: | ||
schedule: | ||
- cron: "0 0 * * *" | ||
|
||
jobs: | ||
formatting: | ||
name: Formatting Check | ||
runs-on: "ubuntu-latest" | ||
validate_hacs: | ||
name: "HACS Validation" | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: "actions/checkout@v2" | ||
- uses: "actions/setup-python@v1" | ||
- name: HACS Action | ||
uses: "hacs/action@main" | ||
with: | ||
python-version: "3.x" | ||
- run: python3 -m pip install black | ||
- run: black . | ||
|
||
validate: | ||
name: Validate component | ||
category: "integration" | ||
validate_hassfest: | ||
name: "Hassfest Validation" | ||
runs-on: "ubuntu-latest" | ||
steps: | ||
- uses: "actions/checkout@v2" | ||
|
||
- name: HACS validation | ||
uses: "hacs/integration/action@master" | ||
with: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
CATEGORY: "integration" | ||
|
||
- name: Hassfest validation | ||
uses: "home-assistant/actions/hassfest@master" | ||
- uses: "actions/checkout@v2" | ||
- uses: home-assistant/actions/hassfest@master | ||
validate_flake8: | ||
name: "flake8" | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
- name: Set up Python 3.9 | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.9 | ||
- name: Cache | ||
uses: actions/cache@v2 | ||
with: | ||
path: ~/.cache/pip | ||
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}-3 | ||
restore-keys: | | ||
${{ runner.os }}-pip- | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip wheel | ||
python -m pip install --upgrade -r requirements.txt wemake-python-styleguide | ||
- name: Check for fatal errors | ||
run: | | ||
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics | ||
- name: Docstrings | ||
run: | | ||
flake8 . --inline-quotes '"' --count --exit-zero --max-complexity=15 --max-line-length=90 --statistics --select=D,DAR | ||
- name: Small tweaks that might help, but might conflict or be inconvenient | ||
run: | | ||
flake8 . --inline-quotes '"' --count --exit-zero --max-complexity=15 --max-line-length=90 --statistics --select=WPS323,WPS336,WPS305,WPS420,WPS440,WPS441,WPS515,E800\:,WPS421,W503,WPS412 | ||
- name: Trailing commas and isort | ||
run: | | ||
flake8 . --inline-quotes '"' --count --exit-zero --max-complexity=15 --max-line-length=90 --statistics --select=I,C81 | ||
- name: Overcomplex code | ||
run: | | ||
flake8 . --inline-quotes '"' --count --exit-zero --max-complexity=15 --max-line-length=90 --statistics --select=WPS201,WPS210,WPS214,WPS221,WPS229,WPS226 | ||
- name: Useless stuff | ||
run: | | ||
flake8 . --inline-quotes '"' --count --exit-zero --max-complexity=15 --max-line-length=90 --statistics --select=F401,F841,WPS327,WPS503,WPS504,WPS507 | ||
- name: Bandit | ||
run: | | ||
flake8 . --inline-quotes '"' --count --exit-zero --max-complexity=15 --max-line-length=90 --statistics --select=S | ||
- name: Clarity and quality improvements | ||
run: | | ||
flake8 . --inline-quotes '"' --count --exit-zero --max-complexity=15 --max-line-length=90 --statistics --select=WPS432,WPS110,WPS111,WPS322,E501 | ||
- name: General stats | ||
run: | | ||
flake8 . --inline-quotes '"' --count --exit-zero --max-complexity=15 --max-line-length=90 --statistics \ | ||
--ignore=D,DAR,WPS323,WPS336,WPS305,WPS420,WPS440,WPS441,WPS515,E800\:,WPS421,W503,WPS412,I,C81,WPS201,WPS210,WPS214,WPS221,WPS229,WPS226,F401,F841,WPS327,WPS503,WPS504,WPS507,S,WPS432,WPS110,WPS111,WPS322,E501 | ||
format: | ||
name: "Format with black and isort" | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
- name: Set up Python 3.8 | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.8 | ||
- name: Cache | ||
uses: actions/cache@v2 | ||
with: | ||
path: ~/.cache/pip | ||
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}-2 | ||
restore-keys: | | ||
${{ runner.os }}-pip-2 | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip wheel | ||
python -m pip install --upgrade -r requirements.txt -r requirements_format.txt | ||
- name: Pull again | ||
run: git pull || true | ||
- name: Run formatting | ||
run: | | ||
python -m isort -v --profile black . | ||
python -m black -v . | ||
- name: Commit files | ||
run: | | ||
if [ $(git diff HEAD | wc -l) -gt 30 ] | ||
then | ||
git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | ||
git config user.name "GitHub Actions" | ||
git commit -a --amend --no-edit || true | ||
git push --force || true | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
name: Pytest | ||
|
||
on: | ||
push: | ||
branches: [0.3.0] | ||
pull_request: | ||
branches: [0.3.0] | ||
schedule: | ||
- cron: "0 7 1-28/7 * *" | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python-version: [3.8, 3.9] | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v1 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install -r requirements_test.txt | ||
- name: Generate coverage report | ||
run: | | ||
python -m pytest | ||
pip install pytest-cov | ||
pytest ./tests/ --cov=custom_components/mail_and_packages/ --cov-report=xml | ||
- name: Upload coverage to Codecov | ||
uses: codecov/codecov-action@v1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
name: Release Drafter | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
- 0.2.0 | ||
- 0.3.0 | ||
|
||
jobs: | ||
update_release_draft: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: release-drafter/release-drafter@v5 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
name: Release | ||
|
||
on: | ||
release: | ||
types: [published] | ||
|
||
jobs: | ||
release_zip_file: | ||
name: Prepare release asset | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out repository | ||
uses: actions/checkout@v1 | ||
|
||
- name: Get Version | ||
id: get_version | ||
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//} | ||
|
||
- name: "Set version numbmer" | ||
run: | | ||
sed -i '/VERSION = /c\VERSION = "${{ steps.get_version.outputs.VERSION }}"' ${{ github.workspace }}/custom_components/mail_and_packages/const.py | ||
sed -i '/version/c\ \"version\": \"${{ steps.get_version.outputs.VERSION }}\"' ${{ github.workspace }}/custom_components/mail_and_packages/manifest.json | ||
# Pack the mail_and_packages dir as a zip and upload to the release | ||
- name: ZIP MnP Dir | ||
run: | | ||
cd ${{ github.workspace }}/custom_components/mail_and_packages | ||
zip mail_and_packages.zip -r ./ | ||
- name: Upload zip to release | ||
uses: svenstaro/upload-release-action@v1-release | ||
with: | ||
repo_token: ${{ secrets.GITHUB_TOKEN }} | ||
file: ${{ github.workspace }}/custom_components/mail_and_packages/mail_and_packages.zip | ||
asset_name: mail_and_packages.zip | ||
tag: ${{ github.ref }} | ||
overwrite: true |
Oops, something went wrong.