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 ''