feat: add build two target and serial flasher example #207
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build with ESP-IDF | |
| on: [push] | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v3 | |
| with: | |
| submodules: 'true' | |
| - name: Set up Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: '3.10' | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install pyyaml | |
| - name: Build projects | |
| shell: bash | |
| run: | | |
| # Read the configuration file | |
| while IFS= read -r line; do | |
| if [[ $line =~ path:[[:space:]]*([^[:space:]]+) ]]; then | |
| project_path="${BASH_REMATCH[1]}" | |
| elif [[ $line =~ idf_version:[[:space:]]*([^[:space:]]+) ]]; then | |
| idf_version="${BASH_REMATCH[1]}" | |
| elif [[ $line =~ target:[[:space:]]*([^[:space:]]+) ]]; then | |
| target="${BASH_REMATCH[1]}" | |
| if [ ! -z "$project_path" ] && [ ! -z "$idf_version" ] && [ ! -z "$target" ]; then | |
| echo "Building $project_path with IDF $idf_version for $target" | |
| docker run --rm -v $PWD:/workspace -w /workspace espressif/idf:$idf_version bash -c " | |
| . ${IDF_PATH}/export.sh | |
| cd $project_path | |
| idf.py set-target $target | |
| idf.py build | |
| " | |
| project_path="" | |
| idf_version="" | |
| target="" | |
| fi | |
| fi | |
| done < build_config.yml |