Skip to content

Commit c1c5667

Browse files
authored
Add CI (#3)
1 parent 4d44197 commit c1c5667

6 files changed

+113
-0
lines changed

.github/dependabot.yml

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# To get started with Dependabot version updates, you'll need to specify which
2+
# package ecosystems to update and where the package manifests are located.
3+
# Please see the documentation for all configuration options:
4+
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
5+
6+
version: 2
7+
updates:
8+
- package-ecosystem: "github-actions"
9+
directory: "/"
10+
schedule:
11+
interval: daily
12+
open-pull-requests-limit: 10
13+
- package-ecosystem: "pip"
14+
directory: "/" # Location of package manifests
15+
schedule:
16+
interval: "weekly"
17+
open-pull-requests-limit: 10

.github/release-drafter.yml

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
change-template: "- #$NUMBER - $TITLE (@$AUTHOR)"
2+
categories:
3+
- title: "⚠ Breaking Changes"
4+
labels:
5+
- "breaking-change"
6+
- title: "⬆️ Dependencies"
7+
collapse-after: 1
8+
labels:
9+
- "dependencies"
10+
template: |
11+
## What’s Changed
12+
13+
$CHANGES

.github/workflows/publish-to-pypi.yml

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Publish releases to PyPI
2+
3+
on:
4+
release:
5+
types: [published, prereleased]
6+
7+
jobs:
8+
build-and-publish:
9+
name: Builds and publishes releases to PyPI
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@master
13+
- name: Set up Python 3.9
14+
uses: actions/setup-python@v4.0.0
15+
with:
16+
python-version: 3.9
17+
- name: Install build
18+
run: >-
19+
pip install build
20+
- name: Build
21+
run: >-
22+
python3 -m build
23+
- name: Publish release to PyPI
24+
uses: pypa/gh-action-pypi-publish@master
25+
with:
26+
user: __token__
27+
password: ${{ secrets.PYPI_TOKEN }}

.github/workflows/release-drafter.yml

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: Release Drafter
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
update_release_draft:
10+
runs-on: ubuntu-latest
11+
steps:
12+
# Drafts your next Release notes as Pull Requests are merged into "master"
13+
- uses: release-drafter/release-drafter@v5
14+
env:
15+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/test.yml

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# This workflow will install Python dependencies, run tests and lint
2+
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
3+
4+
name: Test
5+
6+
on:
7+
push:
8+
branches: [main]
9+
pull_request:
10+
branches: [main]
11+
12+
jobs:
13+
build:
14+
runs-on: ubuntu-latest
15+
strategy:
16+
matrix:
17+
python-version:
18+
- "3.9"
19+
- "3.10"
20+
21+
steps:
22+
- uses: actions/checkout@v2.3.4
23+
with:
24+
fetch-depth: 2
25+
- name: Set up Python ${{ matrix.python-version }}
26+
uses: actions/setup-python@v4.0.0
27+
with:
28+
python-version: ${{ matrix.python-version }}
29+
- name: Install dependencies
30+
run: |
31+
python -m pip install --upgrade pip
32+
pip install -r requirements-test.txt
33+
- name: Flake8
34+
run: flake8 custom_components matter_server/client matter_server/common matter_server/server
35+
- name: Black
36+
run: black --check custom_components matter_server/client matter_server/common matter_server/server
37+
- name: isort
38+
run: isort --check custom_components matter_server/client matter_server/common matter_server/server

requirements-test.txt

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
isort==5.10.1
2+
black==22.3.0
3+
flake8==4.0.1

0 commit comments

Comments
 (0)