From 207eb034670573928c942ae206a9e59c30729aba Mon Sep 17 00:00:00 2001 From: Jacques Gagnon Date: Tue, 13 Feb 2024 22:24:23 -0500 Subject: [PATCH] test --- .github/workflows/build.yml | 47 ++++++++++---------------------- .github/workflows/newidf.yml | 52 ++++++++++-------------------------- .github/workflows/pytest.yml | 48 +++++++-------------------------- .github/workflows/quick.yml | 5 +--- 4 files changed, 39 insertions(+), 113 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ac24eb1c..be31db7e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -24,46 +24,27 @@ jobs: br_config: qemu_bt_trace_replay - hw_version: dbg br_config: qemu_bt_trace_replay_test - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 + container: + image: ghcr.io/darthcloud/idf-blueretro:v5.2.0_2023-10-09 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: Checkout repo + uses: actions/checkout@v4 + with: + submodules: recursive + fetch-depth: 0 - name: Build with ESP-IDF - working-directory: ./BlueRetro run: | - . ../esp-idf/export.sh + . $IDF_PATH/export.sh echo "br_version=$(git describe --always --tags --dirty)" >> $GITHUB_ENV rm -fr build echo "$(git describe --always --tags --dirty) ${{ matrix.hw_version }} ${{ matrix.br_config }}" | cut -c -31 > version.txt cat version.txt cp configs/${{ matrix.hw_version }}/${{ matrix.br_config }} sdkconfig BR_HW=_${{ matrix.hw_version }} BR_SYS=_${{ matrix.br_config }} idf.py reconfigure build - env: - IDF_TOOLS_PATH : "/home/runner/work/BlueRetro/BlueRetro/BlueRetroRoot/" - name: Copy OTA initial binary - working-directory: ./BlueRetro/build + working-directory: ./build run: | mkdir ota mv ota_data_initial.bin ota/ @@ -72,8 +53,8 @@ jobs: with: name: ${{ env.br_version }}_${{ matrix.hw_version }} path: | - BlueRetro/build/partition_table/partition-table.bin - BlueRetro/build/bootloader/bootloader.bin - BlueRetro/build/ota/ota_data_initial.bin - BlueRetro/build/BlueRetro*.bin + build/partition_table/partition-table.bin + build/bootloader/bootloader.bin + build/ota/ota_data_initial.bin + build/BlueRetro*.bin if-no-files-found: error diff --git a/.github/workflows/newidf.yml b/.github/workflows/newidf.yml index 20bf8f39..60a9dd4f 100644 --- a/.github/workflows/newidf.yml +++ b/.github/workflows/newidf.yml @@ -22,51 +22,27 @@ jobs: br_config: qemu_bt_trace_replay - hw_version: dbg br_config: qemu_bt_trace_replay_test - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 + container: + image: ghcr.io/darthcloud/idf-blueretro:v5.2.0_2023-10-09 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 --remote - cd esp-idf - git submodule update --init --recursive - cd ../BlueRetro - 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: Checkout repo + uses: actions/checkout@v4 + with: + submodules: recursive + fetch-depth: 0 - name: Build with ESP-IDF - working-directory: ./BlueRetro run: | - . ../esp-idf/export.sh + . $IDF_PATH/export.sh echo "br_version=$(git describe --always --tags --dirty)" >> $GITHUB_ENV rm -fr build echo "$(git describe --always --tags --dirty) ${{ matrix.hw_version }} ${{ matrix.br_config }}" | cut -c -31 > version.txt cat version.txt cp configs/${{ matrix.hw_version }}/${{ matrix.br_config }} sdkconfig BR_HW=_${{ matrix.hw_version }} BR_SYS=_${{ matrix.br_config }} idf.py reconfigure build - env: - IDF_TOOLS_PATH : "/home/runner/work/BlueRetro/BlueRetro/BlueRetroRoot/" - name: Copy OTA initial binary - working-directory: ./BlueRetro/build + working-directory: ./build run: | mkdir ota mv ota_data_initial.bin ota/ @@ -75,8 +51,8 @@ jobs: with: name: ${{ env.br_version }}_${{ matrix.hw_version }} path: | - BlueRetro/build/partition_table/partition-table.bin - BlueRetro/build/bootloader/bootloader.bin - BlueRetro/build/ota/ota_data_initial.bin - BlueRetro/build/BlueRetro*.bin + build/partition_table/partition-table.bin + build/bootloader/bootloader.bin + build/ota/ota_data_initial.bin + build/BlueRetro*.bin if-no-files-found: error diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 8db3fa42..281bf562 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -8,57 +8,29 @@ on: jobs: build: - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 + container: + image: ghcr.io/darthcloud/idf-blueretro:v5.2.0_2023-10-09 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: Checkout repo + uses: actions/checkout@v4 + with: + submodules: recursive + fetch-depth: 0 - name: Build with ESP-IDF - working-directory: ./BlueRetro run: | - . ../esp-idf/export.sh + . $IDF_PATH/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 + . $IDF_PATH/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/" diff --git a/.github/workflows/quick.yml b/.github/workflows/quick.yml index dd8a315f..99ed68cb 100644 --- a/.github/workflows/quick.yml +++ b/.github/workflows/quick.yml @@ -13,12 +13,9 @@ on: jobs: build: - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 container: image: ghcr.io/darthcloud/idf-blueretro:v5.2.0_2023-10-09 - credentials: - username: darthcloud - password: ${{ secrets.DOCKER_CONTAINER_REGISTRY_TOKEN }} steps: - name: Checkout repo