Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor actions script #132

Merged
merged 12 commits into from
Jan 18, 2023
22 changes: 22 additions & 0 deletions .github/workflows/test-install-script.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,25 @@ jobs:
- name: Install ESP-IDF
run: |
bash wall_e_install.sh

macos:
strategy:
matrix:
include:
- name: MacOS-latest
host_runner: macos-latest
name: ${{ matrix.name }}
runs-on: ${{ matrix.host_runner }}

steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Install ESP-IDF
run: |
brew uninstall --ignore-dependencies python3
brew cleanup --prune=1 -s
sudo rm -rf /Library/Frameworks/Python.framework/Versions/
brew install python@3.10
bash wall_e_install.sh
4 changes: 4 additions & 0 deletions .github/workflows/validate-install-script.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,12 @@ name: Validate-YAML
on:
push:
branches: [ master ]
paths:
- '.github/workflows/test-install-script.yml'
pull_request:
branches: [ master ]
paths:
- '.github/workflows/test-install-script.yml'

jobs:
validate-yaml:
Expand Down
20 changes: 17 additions & 3 deletions wall_e_install.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,23 @@
#!/usr/bin/env bash
set -e

echo "installing ESP IDF"

_shell_="${SHELL#${SHELL%/*}/}"

_sudo(){
if ! command -v sudo &> /dev/null
then
if ! [ $(id -u) = 0 ]; then
echo "The script need to be run as root." >&2
exit 1
fi
"$@"
else
sudo "$@"
fi
}

# Check whether esp-idf has already been installed
if [ -d $HOME/esp/esp-idf ]; then
echo "You have installed esp-idf" && exit 0
Expand All @@ -12,9 +26,9 @@ fi
unameOut="$(uname -s)"
case "${unameOut}" in
Linux*)
sudo apt update && sudo apt upgrade -y
sudo usermod -a -G dialout $USER
sudo apt install git wget flex bison gperf python3 python3-pip python3-setuptools cmake ninja-build ccache libffi-dev libssl-dev dfu-util libusb-1.0-0 -y
export DEBIAN_FRONTEND=noninteractive
_sudo apt update && _sudo apt upgrade -y
_sudo apt install git wget flex bison gperf python3 python3-pip python3-setuptools cmake ninja-build ccache libffi-dev libssl-dev dfu-util libusb-1.0-0 -y
Comment on lines +30 to +31
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

export DEBIAN_FRONTEND=noninteractive

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and then do apt stuff

;;
Darwin*)
if brew --version | grep -q 'Homebrew'; then
Expand Down