43 lines
1.3 KiB
YAML
43 lines
1.3 KiB
YAML
name: Compile All
|
|
|
|
on:
|
|
push:
|
|
branches: ["main"]
|
|
pull_request:
|
|
branches: ["main"]
|
|
|
|
jobs:
|
|
compile:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Install Nix
|
|
uses: DeterminateSystems/nix-installer-action@main
|
|
|
|
- name: Setup secrets
|
|
run: |
|
|
cp secrets.yaml.sample secrets.yaml
|
|
cp templates/secrets.yaml.sample templates/secrets.yaml
|
|
|
|
- name: Cache PlatformIO packages
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: ~/.platformio
|
|
# Keyed on ESPHome version + YAML configs; bust when deps change
|
|
key: platformio-${{ hashFiles('flake.lock', '*.yaml', 'templates/*.yaml') }}
|
|
restore-keys: platformio-
|
|
|
|
- name: Cache ESPHome build artifacts
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: .esphome
|
|
key: esphome-${{ hashFiles('*.yaml', 'templates/*.yaml') }}
|
|
restore-keys: esphome-
|
|
|
|
# Uses the ci shell, which installs esphome via pipx at the exact version
|
|
# pinned in Nix. The ci shell avoids nixpkgs wrapping platformio in bwrap,
|
|
# which fails on CI runners that disallow unprivileged user namespaces.
|
|
- name: Compile All
|
|
run: nix develop .#ci --command make compile-all
|