Skip to content

Commit

Permalink
add action
Browse files Browse the repository at this point in the history
  • Loading branch information
ahiuchingau committed Jan 11, 2024
1 parent 99a6b9b commit 94ca69c
Show file tree
Hide file tree
Showing 3 changed files with 81 additions and 0 deletions.
19 changes: 19 additions & 0 deletions .github/actions/cache-stm32-tools/action.yaml
Original file line number Diff line number Diff line change
@@ -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'}}
30 changes: 30 additions & 0 deletions .github/actions/cross-compile-setup/action.yaml
Original file line number Diff line number Diff line change
@@ -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 }}
32 changes: 32 additions & 0 deletions .github/actions/host-compile-setup/action.yaml
Original file line number Diff line number Diff line change
@@ -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 [email protected]
$OT_PYTHON -m pip install pipenv==2023.11.15
- shell: bash
run: 'make -C ${{ inputs.project }} setup'

0 comments on commit 94ca69c

Please sign in to comment.