github workflow to compile esphome files
Compile ESPHome / compile (push) Has been cancelled

This commit is contained in:
2026-05-10 16:30:32 +00:00
parent ec837d2c28
commit 616f5c5aa3
3 changed files with 48 additions and 0 deletions
+45
View File
@@ -0,0 +1,45 @@
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 ''
+1
View File
@@ -18,6 +18,7 @@
esphome
esptool
cc2538-bsl
zsh
];
shellHook = ''
+2
View File
@@ -96,7 +96,9 @@ for cmdline in "${flash[@]}"; do
flash_result["$cmdline"]=OK
else
flash_result["$cmdline"]=FAIL
exit_code=1
fi
done
print_results_table
exit ${exit_code:-0}