Skip to content

Expose air filter expiry date as HA timestamp sensor #181

Expose air filter expiry date as HA timestamp sensor

Expose air filter expiry date as HA timestamp sensor #181

Workflow file for this run

name: CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
protocol-tests:
name: Parser unit tests (host)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Cache CMake deps
uses: actions/cache@v4
with:
path: tests/cpp/build/_deps
key: ${{ runner.os }}-cmake-deps-${{ hashFiles('tests/cpp/CMakeLists.txt') }}
- name: Configure
run: cmake -S tests/cpp -B tests/cpp/build
- name: Build
run: cmake --build tests/cpp/build -j
- name: Run tests
run: ctest --test-dir tests/cpp/build --output-on-failure
validate:
name: Validate ESPHome configs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install ESPHome
run: pip install esphome
- name: Create dummy secrets
run: |
cat > secrets.yaml <<'EOF'
wifi_ssid: "test-ssid"
wifi_password: "test-password"
right_dishwasher_mac: "00:06:80:00:00:01"
right_dishwasher_pin: "000001"
kitchen_range_mac: "00:06:80:00:00:02"
kitchen_range_pin: "000002"
main_fridge_mac: "00:06:80:00:00:03"
main_fridge_pin: "000003"
EOF
- name: Patch package refs for CI
env:
HEAD_REPO: ${{ github.event.pull_request.head.repo.full_name }}
run: |
# Point package refs to the code under test instead of a published tag.
# PRs: use the head repo + source branch name (supports fork PRs).
# Pushes: stay on the default repo and use the commit SHA.
# Use # as sed delimiter — branch names may contain / (so | was used
# before), but extended-regex alternation also needs |, which GNU
# sed eats as the delimiter. # is safe in both pattern and replacement.
REF="${GITHUB_HEAD_REF:-$GITHUB_SHA}"
REPO="${HEAD_REPO:-$GITHUB_REPOSITORY}"
sed -i -E "s#url: https://github.com/[^[:space:]]+#url: https://github.com/${REPO}#" \
cove-minimal-dishwasher.yaml wolf-minimal-range.yaml wolf-minimal-fridge.yaml
sed -i -E "s#ref: (v[0-9]+\.[0-9]+\.[0-9]+|main)#ref: ${REF}#" \
cove-minimal-dishwasher.yaml wolf-minimal-range.yaml wolf-minimal-fridge.yaml
- name: Validate configs
run: |
for yaml in cove-minimal-dishwasher.yaml wolf-minimal-range.yaml wolf-minimal-fridge.yaml; do
echo "::group::Validating $yaml"
esphome config "$yaml"
echo "::endgroup::"
done
compile:
name: Compile ${{ matrix.file }}
runs-on: ubuntu-latest
needs: validate
strategy:
fail-fast: false
matrix:
file:
- cove-minimal-dishwasher.yaml
- wolf-minimal-range.yaml
- wolf-minimal-fridge.yaml
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install ESPHome
run: pip install esphome
- name: Create dummy secrets
run: |
cat > secrets.yaml <<'EOF'
wifi_ssid: "test-ssid"
wifi_password: "test-password"
right_dishwasher_mac: "00:06:80:00:00:01"
right_dishwasher_pin: "000001"
kitchen_range_mac: "00:06:80:00:00:02"
kitchen_range_pin: "000002"
main_fridge_mac: "00:06:80:00:00:03"
main_fridge_pin: "000003"
EOF
- name: Patch package refs for CI
env:
HEAD_REPO: ${{ github.event.pull_request.head.repo.full_name }}
run: |
# Use # as sed delimiter — branch names may contain / (so | was used
# before), but extended-regex alternation also needs |, which GNU
# sed eats as the delimiter. # is safe in both pattern and replacement.
REF="${GITHUB_HEAD_REF:-$GITHUB_SHA}"
REPO="${HEAD_REPO:-$GITHUB_REPOSITORY}"
sed -i -E "s#url: https://github.com/[^[:space:]]+#url: https://github.com/${REPO}#" "${{ matrix.file }}"
sed -i -E "s#ref: (v[0-9]+\.[0-9]+\.[0-9]+|main)#ref: ${REF}#" "${{ matrix.file }}"
- name: Compile ${{ matrix.file }}
run: esphome compile "${{ matrix.file }}"