Files
esphome/.github/workflows/compile.yaml
T
artem 616f5c5aa3
Compile ESPHome / compile (push) Has been cancelled
github workflow to compile esphome files
2026-05-10 16:30:32 +00:00

46 lines
1.3 KiB
YAML

name: Compile ESPHome
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_dispatch:
jobs:
compile:
# ubuntu-22.04 is more stable regarding unprivileged user namespaces than 24.04
runs-on: ubuntu-22.04
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
run: |
# Standard fixes for bubblewrap in CI
sudo sysctl -w kernel.unprivileged_userns_clone=1 || true
# Fix for newer kernels/Ubuntu versions that restrict unprivileged userns via AppArmor
sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0 || true
- name: Install direnv
run: sudo apt-get update && sudo apt-get install -y direnv
- 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: Allow direnv
run: direnv allow .
- name: Compile
# Using direnv exec as originally requested, now that environment issues are mitigated
run: direnv exec . ./reflash.sh compile ''