This commit is contained in:
@@ -0,0 +1,40 @@
|
|||||||
|
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 ''
|
||||||
@@ -18,6 +18,7 @@
|
|||||||
esphome
|
esphome
|
||||||
esptool
|
esptool
|
||||||
cc2538-bsl
|
cc2538-bsl
|
||||||
|
zsh
|
||||||
];
|
];
|
||||||
|
|
||||||
shellHook = ''
|
shellHook = ''
|
||||||
|
|||||||
@@ -96,7 +96,9 @@ for cmdline in "${flash[@]}"; do
|
|||||||
flash_result["$cmdline"]=OK
|
flash_result["$cmdline"]=OK
|
||||||
else
|
else
|
||||||
flash_result["$cmdline"]=FAIL
|
flash_result["$cmdline"]=FAIL
|
||||||
|
exit_code=1
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
print_results_table
|
print_results_table
|
||||||
|
exit ${exit_code:-0}
|
||||||
|
|||||||
Reference in New Issue
Block a user