forked from esphome/device-builder
-
Notifications
You must be signed in to change notification settings - Fork 0
83 lines (74 loc) · 3.29 KB
/
Copy pathreal-compile-tests.yml
File metadata and controls
83 lines (74 loc) · 3.29 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
name: Real-compile tests
# End-to-end tests under ``tests/real_compile/`` that spawn an
# actual ``esphome compile`` subprocess (PlatformIO → downloads
# + compiles a tiny ESP8266 firmware), so a single test easily
# runs minutes. The default ``test`` workflow excludes this tree
# via ``--ignore=tests/real_compile``; this workflow runs it on
# its own — but only when the diff actually touches the surfaces
# these tests pin (the materialiser, the receiver-side packer,
# the storage-path resolver, or the tests themselves). Ordinary
# bugfix / docs / catalog PRs don't trigger it.
#
# If you add a new test under ``tests/real_compile/`` that
# depends on additional surfaces, extend the ``paths:`` filter
# below so the gate stays meaningful.
#
# YAML anchors (``&trigger-paths`` / ``*trigger-paths``) keep
# the push and pull_request path filters in lockstep — GitHub
# Actions resolves anchors at YAML parse time, so the two
# triggers see one shared list.
permissions:
contents: read
on:
push:
branches: [main]
paths: &trigger-paths
- "esphome_device_builder/helpers/remote_artifacts_materialise.py"
- "esphome_device_builder/controllers/remote_build/artifacts_tarball.py"
- "esphome_device_builder/helpers/storage_path.py"
- "tests/real_compile/**"
- ".github/workflows/real-compile-tests.yml"
pull_request:
branches: [main]
paths: *trigger-paths
jobs:
real_compile:
name: Real esphome compile (round-trip pins)
runs-on: ubuntu-latest
# PlatformIO toolchain download + cold ESP8266 compile lands
# around 4-5 minutes on a fresh runner; the second compile in
# the pin-test is incremental (~5 s). 15 minutes is generous
# headroom against a flaky toolchain mirror.
timeout-minutes: 15
steps:
- name: Check out code from GitHub
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- name: Set up Python
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: "3.13"
- name: Set up uv
uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
with:
enable-cache: true
- name: Install package + test deps
run: uv pip install --system -e '.[esphome,test]'
- name: Cache PlatformIO core + per-platform toolchains
# ``~/.platformio`` holds PIO's wheel cache, downloaded
# toolchains, and per-platform package state. The cache
# key includes the test tree's hash so a deliberate change
# to the YAML in a test (different platform, different
# board) invalidates without manual bumps.
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
with:
path: ~/.platformio
key: pio-real-compile-${{ runner.os }}-${{ hashFiles('tests/real_compile/**') }}
restore-keys: |
pio-real-compile-${{ runner.os }}-
- name: Run real-compile tests
# ``--timeout=600`` overrides the 10s default in
# ``pyproject.toml`` (real compiles run minutes). The
# per-test ``@pytest.mark.timeout(...)`` decorator wins
# over both, so individual tests can opt for tighter or
# looser caps.
run: pytest -v tests/real_compile --timeout=600 --no-cov