[ACTION] Use own custom image with pre-installed idf #111
This file contains 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: pytest | |
on: | |
push: | |
branches: [ master ] | |
pull_request: | |
branches: [ master ] | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Install ESP-IDF prerequisite | |
run: | | |
sudo add-apt-repository -y "deb http://archive.ubuntu.com/ubuntu `lsb_release -sc` main universe restricted multiverse" | |
sudo apt-get update -y -qq | |
sudo apt-get install git wget flex bison gperf python3 python3-pip python3-setuptools cmake ninja-build ccache libffi-dev libssl-dev dfu-util | |
- name: Set python3 default | |
run: sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 10 && alias pip=pip3 | |
- name: Clone BlueRetroRoot | |
run: git clone https://github.com/darthcloud/BlueRetroRoot.git . | |
- name: Fetch submodules | |
run: git submodule update --init --recursive | |
- name: Checkout main repo | |
working-directory: ./BlueRetro | |
run: | | |
git fetch --force https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git "+refs/heads/*:refs/remotes/origin/*" | |
git fetch --force https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git "+refs/pull/*:refs/remotes/origin/pr/*" | |
git checkout ${{ github.sha }} || git checkout ${{ github.event.pull_request.head.sha }} | |
git submodule update --init --recursive | |
- name: Install ESP-IDF | |
working-directory: ./esp-idf | |
run: sh ./install.sh | |
env: | |
IDF_TOOLS_PATH : "/home/runner/work/BlueRetro/BlueRetro/BlueRetroRoot/" | |
- name: Build with ESP-IDF | |
working-directory: ./BlueRetro | |
run: | | |
. ../esp-idf/export.sh | |
echo "br_version=$(git describe --always --tags --dirty)" >> $GITHUB_ENV | |
echo "$(git describe --always --tags --dirty) dbg qemu" | cut -c -31 > version.txt | |
cat version.txt | |
cp configs/dbg/qemu sdkconfig | |
idf.py build | |
env: | |
IDF_TOOLS_PATH : "/home/runner/work/BlueRetro/BlueRetro/BlueRetroRoot/" | |
- name: Setup QEMU | |
working-directory: /home/runner/work | |
run: | | |
curl -L $(curl -s https://api.github.com/repos/espressif/qemu/releases/latest | jq '.assets[] | select(.name|match("xtensa")) | select(.name|match("x86_64")) | select(.name|match("linux")) | .browser_download_url' | tr -d '"') | tar xJ | |
echo "/home/runner/work/qemu/bin" >> $GITHUB_PATH | |
sudo apt-get install libslirp0 libsdl2-2.0-0 | |
- name: Run pytest | |
working-directory: ./BlueRetro | |
run: | | |
. ../esp-idf/export.sh | |
(cd build; esptool.py --chip esp32 merge_bin --fill-flash-size 4MB -o flash_image.bin @flash_args) | |
qemu-system-xtensa -machine esp32 -drive file=build/flash_image.bin,if=mtd,format=raw -serial tcp::5555,server,nowait -display none -daemonize | |
pip install numpy | |
pip install pytest | |
pytest | |
env: | |
IDF_TOOLS_PATH : "/home/runner/work/BlueRetro/BlueRetro/BlueRetroRoot/" |