esp-rs / rust-build

Installation tools and workflows for deploying/building Rust fork esp-rs/rust with Xtensa and RISC-V support

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Docker image espressif/idf-rust:all_1.68.0.0 integration with GitHubAction is complex

georgik opened this issue · comments

Problem: How to use the image to produce an artifact with GitHub action.

One issue is that GitHub is using it's own home and other options passed to docker daemon during start:

/usr/bin/docker create --name 9633e03c5a3d47c2b4db54ae8fad2209_espressifidfrustall_16800_121bdf --label 6c0442 --workdir /__w/esp32-spooky-maze-game/esp32-spooky-maze-game --network github_network_b57545e9831f4da3b8035eb9b8e8af0e --user esp --workdir /home/esp -e "HOME=/github/home" -e GITHUB_ACTIONS=true -e CI=true -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/home/runner/work":"/__w" -v "/home/runner/runners/2.303.0/externals":"/__e":ro -v "/home/runner/work/_temp":"/__w/_temp" -v "/home/runner/work/_actions":"/__w/_actions" -v "/opt/hostedtoolcache":"/__t" -v "/home/runner/work/_temp/_github_home":"/github/home" -v "/home/runner/work/_temp/_github_workflow":"/github/workflow" --entrypoint "tail" espressif/idf-rust:all_1.68.0.0 "-f" "/dev/null"

It also does not assume existence of user esp. This will result in permission denied when cloning or building application.

One workaround is to switch HOME variable and directory before launching any build and do the clone manually without using Github action like this:

  build:
    runs-on: ubuntu-20.04
    container:
      image: espressif/idf-rust:all_1.68.0.0
      options: --user esp
    needs: get_release
    steps:
#      - uses: actions/checkout@v3
      - name: Build ESP32 Rust Binaries
        run: |
          export HOME=/home/esp
          cd /home/esp
          pwd
          git clone --depth 1 https://github.com/georgik/esp32-spooky-maze-game.git project
          cd project
          ./support/ci/build-esp32-firmware.sh

Expected behavior: Build works just by specifying container and without workaround commands.

This is limitation of GitHub actions/runner#863