Files
esphome/.github/workflows/compile.yaml
T
artem 326dcc08a8
Compile ESPHome / compile (push) Has been cancelled
github workflow to compile esphome files
2026-05-10 16:28:35 +00:00

41 lines
1.3 KiB
YAML

name: Compile ESPHome
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_dispatch:
jobs:
compile:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Nix
uses: cachix/install-nix-action@v30
with:
nix_path: nixpkgs=channel:nixos-unstable
- name: Enable unprivileged user namespaces
# Some newer Ubuntu runners (24.04+) require this for bubblewrap/Nix FHS
run: |
sudo sysctl -w kernel.unprivileged_userns_clone=1 || true
# Apparmor can also block unprivileged userns on newer Ubuntu
sudo sh -c 'echo "kernel.unprivileged_userns_clone=1" > /etc/sysctl.d/99-userns.conf'
sudo sysctl -p /etc/sysctl.d/99-userns.conf || true
- name: Prepare secrets
run: |
if [ -f templates/secrets.yaml.sample ]; then
cp templates/secrets.yaml.sample secrets.yaml
elif [ -f secrets.yaml.sample ]; then
cp secrets.yaml.sample secrets.yaml
fi
- name: Compile
# Use nix develop to run the script in the flake environment.
# This avoids direnv 'allow' issues and sudo environment scrubbing.
run: nix develop --command ./reflash.sh compile ''