diff --git a/.github/actions/cache-stm32-tools/action.yaml b/.github/actions/cache-stm32-tools/action.yaml new file mode 100644 index 000000000..04639a445 --- /dev/null +++ b/.github/actions/cache-stm32-tools/action.yaml @@ -0,0 +1,19 @@ +name: 'Caching STM32 Tools' +description: 'Set up the environment for cross compile' + +runs: + using: 'composite' + steps: + - shell: bash + run: echo the path is ${{ github.workspace }} + - name: Cache STM32 Tools + uses: actions/cache@v3 + id: cache-tools + with: + path: ot3-firmware/stm32-tools + key: ${{ runner.os }}-${{ hashFiles('**/cmake/*') }}-P6DpDkHzFfZ1Bry3666J + fail-on-cache-miss: false +# +# - name: Print Cache +# shell: bash +# run: echo did we find ${{steps.cache-tools.outputs.cache-hit != 'true'}} diff --git a/.github/actions/cross-compile-setup/action.yaml b/.github/actions/cross-compile-setup/action.yaml new file mode 100644 index 000000000..aecb5ad5e --- /dev/null +++ b/.github/actions/cross-compile-setup/action.yaml @@ -0,0 +1,30 @@ +name: 'Cross Compile Setup' +description: 'Set up the environment for cross compile' +inputs: + target: + description: 'Which preset firmware target to build' + required: true +runs: + using: 'composite' + steps: + - name: Update and install gcc-10 & g++-10 + shell: bash + run: | + sudo apt update + sudo apt install -y gcc-10 g++-10 + + - name: Checkout ot3-firmware repository + uses: actions/checkout@v3 + with: + path: ot3-firmware + + - name: Checkout opentrons repository + uses: actions/checkout@v3 + with: + repository: "Opentrons/opentrons" + path: opentrons + + - uses: "actions/cache@v3" + with: + path: "./stm32-tools" + key: ${{ runner.os }}-${{ hashFiles('**/cmake/*') }}-${{ secrets.CACHE_VERSION }} \ No newline at end of file diff --git a/.github/actions/host-compile-setup/action.yaml b/.github/actions/host-compile-setup/action.yaml new file mode 100644 index 000000000..e487a6766 --- /dev/null +++ b/.github/actions/host-compile-setup/action.yaml @@ -0,0 +1,32 @@ +name: 'Host Compile Setup' +description: 'Set up the environment for host compile' +inputs: + target: + description: 'Which preset firmware target to build' + required: true + python-version: + description: "What Python version to use to create the project's virtual environment" + required: false + default: "3.10" +runs: + using: 'composite' + steps: + - shell: bash + run: | + if [[ "${OSTYPE}" =~ "linux" ]]; then + sudo apt-get update + sudo apt-get install -y --no-install-recommends libsystemd-dev + fi + - name: Set the OT_PYTHON env variable + shell: bash + run: echo "OT_PYTHON=$(which python)" >> $GITHUB_ENV + - name: If provided set the OT_VIRTUALENV_VERSION env variable + shell : bash + if: ${{ inputs.python-version != 'false' }} + run: echo "OT_VIRTUALENV_VERSION=${{ inputs.python-version }}" >> $GITHUB_ENV + - shell: bash + run: | + npm install --global shx@0.3.3 + $OT_PYTHON -m pip install pipenv==2023.11.15 + - shell: bash + run: 'make -C ${{ inputs.project }} setup'