|
| 1 | +name: Fetch external deps |
| 2 | + |
| 3 | +inputs: |
| 4 | + action: |
| 5 | + required: false |
| 6 | + default: restore |
| 7 | + type: choice |
| 8 | + options: |
| 9 | + - cache |
| 10 | + - restore |
| 11 | + |
| 12 | + platform: |
| 13 | + required: false |
| 14 | + default: none |
| 15 | + type: choice |
| 16 | + options: |
| 17 | + - arm |
| 18 | + - aarch |
| 19 | + - esp |
| 20 | + - riscv |
| 21 | + - none |
| 22 | + |
| 23 | +runs: |
| 24 | + using: composite |
| 25 | + steps: |
| 26 | + # aarch |
| 27 | + - name: Get aarch toolchain |
| 28 | + if: inputs.platform == 'aarch' |
| 29 | + run: | |
| 30 | + wget --no-verbose https://adafruit-circuit-python.s3.amazonaws.com/gcc-arm-10.3-2021.07-x86_64-aarch64-none-elf.tar.xz |
| 31 | + sudo tar -C /usr --strip-components=1 -xaf gcc-arm-10.3-2021.07-x86_64-aarch64-none-elf.tar.xz |
| 32 | + sudo apt-get install -y mtools |
| 33 | + shell: bash |
| 34 | + - name: Install mkfs.fat |
| 35 | + if: inputs.platform == 'aarch' |
| 36 | + run: | |
| 37 | + wget https://github.com/dosfstools/dosfstools/releases/download/v4.2/dosfstools-4.2.tar.gz |
| 38 | + tar -xaf dosfstools-4.2.tar.gz |
| 39 | + cd dosfstools-4.2 |
| 40 | + ./configure |
| 41 | + make -j 2 |
| 42 | + cd src |
| 43 | + echo >> $GITHUB_PATH $(pwd) |
| 44 | + shell: bash |
| 45 | + |
| 46 | + # arm |
| 47 | + - name: Get arm toolchain |
| 48 | + if: inputs.platform == 'aarch' || inputs.platform == 'arm' |
| 49 | + uses: carlosperate/arm-none-eabi-gcc-action@v1 |
| 50 | + with: |
| 51 | + release: '10-2020-q4' |
| 52 | + |
| 53 | + # esp |
| 54 | + - name: Get esp toolchain |
| 55 | + if: inputs.platform == 'esp' |
| 56 | + run: sudo apt-get install -y ninja-build |
| 57 | + shell: bash |
| 58 | + - name: Install IDF tools |
| 59 | + if: inputs.platform == 'esp' |
| 60 | + run: | |
| 61 | + echo "Installing ESP-IDF tools" |
| 62 | + $IDF_PATH/tools/idf_tools.py --non-interactive install required |
| 63 | + $IDF_PATH/tools/idf_tools.py --non-interactive install cmake |
| 64 | + echo "Installing Python environment and packages" |
| 65 | + $IDF_PATH/tools/idf_tools.py --non-interactive install-python-env |
| 66 | + rm -rf $IDF_TOOLS_PATH/dist |
| 67 | + shell: bash |
| 68 | + - name: Set environment |
| 69 | + if: inputs.platform == 'esp' |
| 70 | + run: | |
| 71 | + source $IDF_PATH/export.sh |
| 72 | + echo >> $GITHUB_ENV "IDF_PYTHON_ENV_PATH=$IDF_PYTHON_ENV_PATH" |
| 73 | + echo >> $GITHUB_PATH "$PATH" |
| 74 | + shell: bash |
| 75 | + |
| 76 | + # riscv |
| 77 | + - name: Get riscv toolchain |
| 78 | + if: inputs.platform == 'riscv' |
| 79 | + run: | |
| 80 | + wget https://static.dev.sifive.com/dev-tools/riscv64-unknown-elf-gcc-8.3.0-2019.08.0-x86_64-linux-centos6.tar.gz |
| 81 | + sudo tar -C /usr --strip-components=1 -xaf riscv64-unknown-elf-gcc-8.3.0-2019.08.0-x86_64-linux-centos6.tar.gz |
| 82 | + shell: bash |
| 83 | + |
| 84 | + # common |
| 85 | + - name: Cache python dependencies |
| 86 | + if: inputs.platform != 'esp' |
| 87 | + uses: ./.github/actions/deps/python |
| 88 | + with: |
| 89 | + action: ${{ inputs.action }} |
| 90 | + - name: Install python dependencies |
| 91 | + run: pip install -r requirements-dev.txt |
| 92 | + shell: bash |
0 commit comments