forked from QuiteYellow/SmartThings-Local
-
Notifications
You must be signed in to change notification settings - Fork 0
130 lines (123 loc) · 3.72 KB
/
Copy pathci.yml
File metadata and controls
130 lines (123 loc) · 3.72 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
name: Validate
on:
pull_request:
branches:
- main
push:
branches:
- main
workflow_dispatch:
permissions:
contents: read
concurrency:
group: validate-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
tests:
name: Python ${{ matrix.python-version }}
runs-on: ubuntu-latest
timeout-minutes: 10
strategy:
fail-fast: false
matrix:
python-version:
- "3.11"
- "3.12"
- "3.13"
- "3.14"
steps:
- uses: actions/checkout@v7
- uses: actions/setup-python@v7
with:
python-version: ${{ matrix.python-version }}
- run: python -m pip install --upgrade pip
- run: python -m pip install -e ".[dev]"
- run: python -m pytest -q
dependency-bounds:
name: Dependencies (${{ matrix.mode }})
runs-on: ubuntu-latest
timeout-minutes: 10
strategy:
fail-fast: false
matrix:
include:
- mode: floor
python-version: "3.11"
- mode: latest
python-version: "3.14"
steps:
- uses: actions/checkout@v7
- uses: actions/setup-python@v7
with:
python-version: ${{ matrix.python-version }}
- run: python -m pip install --upgrade pip
- if: matrix.mode == 'floor'
run: >-
python -m pip install
"cbor2==5.6.0"
"pyOpenSSL==23.1.0"
"pytest==8.0.0"
- if: matrix.mode == 'floor'
run: python -m pip install --no-deps -e .
- if: matrix.mode == 'latest'
run: python -m pip install -e ".[dev]"
- run: python -m pytest -q
package:
name: Package artifacts
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v7
with:
fetch-depth: 0
- uses: actions/setup-python@v7
with:
python-version: "3.14"
- run: python -m pip install --upgrade pip
- run: python -m pip install build hatchling hatch-vcs
- run: python -m build
- run: python tools/check_distribution.py dist
- name: Install and import wheel
run: |
python -m venv "$RUNNER_TEMP/wheel-smoke"
"$RUNNER_TEMP/wheel-smoke/bin/python" -m pip install \
dist/*.whl
cd "$RUNNER_TEMP"
"$RUNNER_TEMP/wheel-smoke/bin/python" -I -c \
"from smartthings_local.protocol.dtls_session import DtlsCoapSession"
- name: Install and import sdist
run: |
python -m venv "$RUNNER_TEMP/sdist-smoke"
"$RUNNER_TEMP/sdist-smoke/bin/python" -m pip install \
dist/*.tar.gz
cd "$RUNNER_TEMP"
"$RUNNER_TEMP/sdist-smoke/bin/python" -I -c \
"from smartthings_local.ocf.state_cache import StateCache"
share-safety:
name: Share safety
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v7
with:
fetch-depth: 0
- uses: actions/setup-python@v7
with:
python-version: "3.14"
- name: Select comparison base
id: comparison
env:
PR_BASE_SHA: ${{ github.event.pull_request.base.sha }}
PUSH_BEFORE_SHA: ${{ github.event.before }}
run: |
if [ -n "$PR_BASE_SHA" ]; then
echo "sha=$PR_BASE_SHA" >> "$GITHUB_OUTPUT"
elif [ -n "$PUSH_BEFORE_SHA" ] && \
[ "$PUSH_BEFORE_SHA" != "0000000000000000000000000000000000000000" ]; then
echo "sha=$PUSH_BEFORE_SHA" >> "$GITHUB_OUTPUT"
else
echo "sha=$(git rev-parse HEAD^)" >> "$GITHUB_OUTPUT"
fi
- run: >-
python tools/check_share_safety.py
--changed-since "${{ steps.comparison.outputs.sha }}"