Skip to content

Commit 5821a01

Browse files
author
Tomer Figenblat
committed
ci: ci work
Signed-off-by: Tomer Figenblat <[email protected]>
1 parent ef383ce commit 5821a01

File tree

15 files changed

+299
-250
lines changed

15 files changed

+299
-250
lines changed

.github/ISSUE_TEMPLATE/bug_report.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ body:
2121
attributes:
2222
label: Module Version
2323
description: What version of `aioswitcher` are you using?
24-
placeholder: ex. 2.0.2
24+
placeholder: ex. 5.1.1
2525
validations:
2626
required: true
2727

@@ -39,6 +39,13 @@ body:
3939
- Switcher Breeze
4040
- Switcher Runner
4141
- Switcher Runner Mini
42+
- Switcher Runner S11
43+
- Switcher Runner S12
44+
- Switcher Light SL01
45+
- Switcher Light SL01 Mini
46+
- Switcher Light SL02
47+
- Switcher Light SL02 Mini
48+
- Switcher Light SL03
4249
validations:
4350
required: true
4451

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ blank_issues_enabled: false
33
contact_links:
44
- name: GitHub Discussions
55
url: https://github.com/TomerFi/aioswitcher/discussions/
6-
about: You can also use Discussions for questions and ideas.
6+
about: Use Discussions for questions and ideas.

.github/auto-me-bot.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@ pr:
1313
conventionalTitle:
1414
tasksList:
1515
autoApprove:
16-
users: ['dependabot', 'allcontributors']
16+
users: ['dependabot']

.github/dependabot.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
---
2+
version: 2
3+
updates:
4+
- package-ecosystem: github-actions
5+
directory: /.github/workflows
6+
schedule:
7+
interval: weekly
8+
labels:
9+
- "type: dependencies"
10+
commit-message:
11+
prefix: "ci"
12+
include: "scope"
13+
assignees:
14+
- "tomerfi"
15+
- "thecode"
16+
- "YogevBokobza"
17+
18+
- package-ecosystem: "pip"
19+
directory: "/"
20+
schedule:
21+
interval: daily
22+
labels:
23+
- "type: dependencies"
24+
commit-message:
25+
prefix: "build"
26+
include: "scope"
27+
assignees:
28+
- "tomerfi"
29+
- "thecode"
30+
- "YogevBokobza"

.github/stale.yml

Lines changed: 0 additions & 16 deletions
This file was deleted.

.github/workflows/docs.yml

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
---
2+
name: Build docs
3+
4+
on:
5+
workflow_call:
6+
inputs:
7+
python_version:
8+
required: true
9+
type: string
10+
description: Python version to run with
11+
checkout_ref:
12+
required: true
13+
type: string
14+
description: Checkout reference
15+
deploy-pages:
16+
required: false
17+
default: false
18+
type: boolean
19+
description: Deploy to GH-pages
20+
secrets:
21+
github_token:
22+
required: false
23+
description: GitHub token required if inputs.deploy-pages is true
24+
25+
jobs:
26+
docs:
27+
runs-on: ubuntu-latest
28+
steps:
29+
- name: Source checkout
30+
uses: actions/checkout@v4
31+
with:
32+
ref: ${{ inputs.checkout_ref }}
33+
34+
- name: Set up Python
35+
uses: actions/setup-python@v5
36+
with:
37+
python-version: ${{ inputs.python_version }}
38+
39+
- name: Cache pip repository
40+
uses: actions/cache@v4
41+
with:
42+
path: ~/.cache/pip
43+
# yamllint disable-line rule:line-length
44+
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}-${{ inputs.python_version }}
45+
46+
- name: Prepare python environment
47+
run: |
48+
pip install -r requirements.txt
49+
poetry config virtualenvs.create true
50+
poetry config virtualenvs.in-project true
51+
52+
- name: Cache poetry virtual environment
53+
uses: actions/cache@v4
54+
with:
55+
path: .venv
56+
# yamllint disable-line rule:line-length
57+
key: ${{ runner.os }}-poetry-docs-${{ hashFiles('**/pyproject.toml') }}-${{ inputs.python_version }}
58+
59+
- name: Build documentation site
60+
run: |
61+
poetry install --no-interaction --no-update --without dev
62+
poetry run poe docs_build
63+
64+
- name: Deploy to GH-Pages
65+
if: ${{ inputs.deploy-pages }}
66+
uses: peaceiris/[email protected]
67+
with:
68+
github_token: ${{ secrets.github_token }}
69+
publish_dir: ./site
70+
cname: aioswitcher.tomfi.info
71+
commit_message: 'docs: deployed documentation site '

.github/workflows/pages.yml

Lines changed: 11 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -2,52 +2,20 @@
22
name: Pages Deploy
33

44
on:
5+
workflow_dispatch:
56
release:
67
types: [published]
78

9+
env:
10+
MAIN_PY_VER: "3.10"
11+
812
jobs:
913
deploy-pages:
10-
runs-on: ubuntu-latest
11-
environment: github-pages
1214
name: Build documentation site and deploy to GH-Pages
13-
steps:
14-
- name: Checkout sources
15-
uses: actions/checkout@v3
16-
with:
17-
ref: ${{ github.ref }}
18-
19-
- name: Setup Python 3.10
20-
uses: actions/setup-python@v4
21-
with:
22-
python-version: "3.10"
23-
24-
- name: Cache pip repository
25-
uses: actions/cache@v3
26-
with:
27-
path: ~/.cache/pip
28-
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
29-
30-
- name: Prepare python environment
31-
run: |
32-
pip install -r requirements.txt
33-
poetry config virtualenvs.create true
34-
poetry config virtualenvs.in-project true
35-
36-
- name: Cache poetry virtual environment
37-
uses: actions/cache@v3
38-
with:
39-
path: .venv
40-
key: ${{ runner.os }}-poetry-${{ hashFiles('**/pyproject.toml') }}
41-
42-
- name: Build documentation site
43-
run: |
44-
poetry install --no-interaction --without dev
45-
poetry run poe docs_build
46-
47-
- name: Deploy to GH-Pages
48-
uses: peaceiris/[email protected]
49-
with:
50-
github_token: ${{ secrets.GITHUB_TOKEN }}
51-
publish_dir: ./site
52-
cname: aioswitcher.tomfi.info
53-
commit_message: 'docs: deployed documentation site '
15+
uses: ./.github/workflows/docs.yml
16+
with:
17+
python_version: ${{ env.MAIN_PY_VER }}
18+
checkout_ref: ${{ github.ref }}
19+
deploy-pages: true
20+
secrets:
21+
github_token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/pr.yml

Lines changed: 18 additions & 96 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ name: Pull request build
33

44
on:
55
pull_request:
6+
branches:
7+
- dev
68

79
env:
810
MAIN_PY_VER: "3.10"
@@ -15,15 +17,15 @@ jobs:
1517
pull-requests: read
1618
steps:
1719
- name: Source checkout
18-
uses: actions/checkout@v3
20+
uses: actions/checkout@v4
1921

2022
- name: Set up Python ${{ env.MAIN_PY_VER }}
21-
uses: actions/setup-python@v4
23+
uses: actions/setup-python@v5
2224
with:
2325
python-version: ${{ env.MAIN_PY_VER }}
2426

2527
- name: Cache pip repository
26-
uses: actions/cache@v3
28+
uses: actions/cache@v4
2729
with:
2830
path: ~/.cache/pip
2931
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}-${{ env.MAIN_PY_VER }}
@@ -35,21 +37,17 @@ jobs:
3537
poetry config virtualenvs.in-project true
3638
3739
- name: Cache poetry virtual environment
38-
uses: actions/cache@v3
40+
uses: actions/cache@v4
3941
with:
4042
path: .venv
4143
key: ${{ runner.os }}-poetry-${{ hashFiles('**/pyproject.toml') }}-${{ env.MAIN_PY_VER }}
4244

43-
- name: Install deno runtime
44-
uses: denoland/[email protected]
45-
4645
- name: Lint the project
4746
run: |
48-
poetry install --no-interaction
47+
poetry install --no-interaction --no-update
4948
poetry run poe lint
5049
5150
test:
52-
runs-on: ubuntu-latest
5351
needs: [lint]
5452
strategy:
5553
matrix:
@@ -58,96 +56,20 @@ jobs:
5856
permissions:
5957
checks: write
6058
pull-requests: write
61-
steps:
62-
- name: Source checkout
63-
uses: actions/checkout@v3
64-
65-
- name: Setup timezone
66-
uses: zcong1993/[email protected]
67-
with:
68-
timezone: Asia/Jerusalem
69-
70-
- name: Set up Python
71-
uses: actions/setup-python@v4
72-
with:
73-
python-version: ${{ matrix.python }}
74-
75-
- name: Cache pip repository
76-
uses: actions/cache@v3
77-
with:
78-
path: ~/.cache/pip
79-
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}-${{ matrix.python }}
80-
81-
- name: Prepare python environment
82-
run: |
83-
pip install -r requirements.txt
84-
poetry config virtualenvs.create true
85-
poetry config virtualenvs.in-project true
86-
87-
- name: Cache poetry virtual environment
88-
uses: actions/cache@v3
89-
with:
90-
path: .venv
91-
key: ${{ runner.os }}-poetry-${{ hashFiles('**/pyproject.toml') }}-${{ matrix.python }}
92-
93-
- name: Install project build dependencies
94-
run: poetry install --no-interaction
95-
96-
- name: Test the project
97-
run: >
98-
if [ ${{ matrix.python }} == ${{ env.MAIN_PY_VER }} ];
99-
then poetry run poe test_rep;
100-
else poetry run poe test; fi
101-
102-
- name: Report test summary
103-
uses: EnricoMi/publish-unit-test-result-action@v2
104-
if: ${{ matrix.python == env.MAIN_PY_VER && always() }}
105-
with:
106-
test_changes_limit: 0
107-
junit_files: ./junit.xml
108-
report_individual_runs: true
109-
110-
- name: Push to CodeCov
111-
uses: codecov/codecov-action@v3
112-
if: ${{ matrix.python == env.MAIN_PY_VER }}
113-
with:
114-
token: ${{ secrets.CODECOV_TOKEN }}
115-
files: ./coverage.xml
59+
uses: ./.github/workflows/test.yml
60+
with:
61+
python_version: ${{ matrix.python }}
62+
push_coverage: ${{ matrix.python }} == ${{ env.MAIN_PY_VER }}
63+
report_tests: ${{ matrix.python }} == ${{ env.MAIN_PY_VER }}
64+
secrets:
65+
codecov_token: ${{ secrets.CODECOV_TOKEN }}
11666

11767
docs:
118-
runs-on: ubuntu-latest
11968
needs: [lint]
12069
name: Verify documentation site
12170
permissions:
12271
pull-requests: read
123-
steps:
124-
- name: Source checkout
125-
uses: actions/checkout@v3
126-
127-
- name: Set up Python
128-
uses: actions/setup-python@v4
129-
with:
130-
python-version: ${{ env.MAIN_PY_VER }}
131-
132-
- name: Cache pip repository
133-
uses: actions/cache@v3
134-
with:
135-
path: ~/.cache/pip
136-
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}-${{ env.MAIN_PY_VER }}
137-
138-
- name: Prepare python environment
139-
run: |
140-
pip install -r requirements.txt
141-
poetry config virtualenvs.create true
142-
poetry config virtualenvs.in-project true
143-
144-
- name: Cache poetry virtual environment
145-
uses: actions/cache@v3
146-
with:
147-
path: .venv
148-
key: ${{ runner.os }}-poetry-${{ hashFiles('**/pyproject.toml') }}-${{ env.MAIN_PY_VER }}
149-
150-
- name: Build documentation site
151-
run: |
152-
poetry install --no-interaction
153-
poetry run poe docs_build
72+
uses: ./.github/workflows/docs.yml
73+
with:
74+
python_version: ${{ env.MAIN_PY_VER }}
75+
checkout_ref: ${{ github.sha }}

0 commit comments

Comments
 (0)