Skip to content

Commit

Permalink
test custom target
Browse files Browse the repository at this point in the history
  • Loading branch information
ahiuchingau committed Jan 8, 2024
1 parent f576d54 commit 16177fe
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 35 deletions.
55 changes: 55 additions & 0 deletions .github/workflows/actions/host-compile-setup/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: 'Host Compiling Setup'
description: 'Set up environment for host compiling'

inputs:
target:
description: 'What firmware target to build'
required: true
python-version:
description: 'What Python version to use to create the virtual environment'
required: false
default: '3.10'

runs:
using: 'composite'
steps:
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: ${{ inputs.python-version }}

- name: Checkout Opentrons monorepo
uses: actions/checkout@v3
with:
repository: Opentrons/opentrons
path: opentrons

- name: Cache stm32-tools
uses: actions/cache@v3
with:
path: ./stm32_tools"
key: ${{ runner.os }}-${{ hashFiles('**/cmake/*') }}-${{ secrets.CACHE_VERSION }}

- name: Configure
run: cmake --preset=host-gcc10 .
working-directory: ot3-firmware

- name: Build and test ${{ inputs.target }}
run: cmake --build ./build-host --target ${{ inputs.target }}-build-and-test
working-directory: ot3-firmware

- name: Setup state_manager
run: cmake --build ./build-host/ --target state-manager-setup
working-directory: ot3-firmware

- name: Build ${{ inputs.target }} simulator
run: cmake --build ./build-host --target gripper-simulator
working-directory: ot3-firmware

- name: Upload artifacts ${{ inputs.target }}
if: ${{ github.event_name != 'pull_request' }}
uses: actions/upload-artifact@v3
with:
name: ${{ inputs.target }}-simulator-${{ github.ref_name }}
path: |
build-host/${{ inputs.target }}/simulator/${{ inputs.target }}-simulator
39 changes: 4 additions & 35 deletions .github/workflows/gripper.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -83,43 +83,12 @@ jobs:
sudo apt install gcc-10 g++-10
- name: Checkout ot3-firmware repository
uses: "actions/checkout@v2"
uses: actions/checkout@v2
with:
fetch-depth: 0
path: ot3-firmware

- name: Checkout opentrons repository
uses: actions/checkout@v3
- name: Host Compile Setup
uses: actions/host-compile-setup/action
with:
repository: "Opentrons/opentrons"
path: opentrons

- name: Cache stm32-tools
uses: "actions/cache@v3"
with:
path: "./stm32-tools"
key: ${{ runner.os }}-${{ hashFiles('**/cmake/*') }}-${{ secrets.CACHE_VERSION }}

- name: "Configure"
run: cmake --preset=host-gcc10 .
working-directory: ot3-firmware

- name: 'Build and test'
run: cmake --build ./build-host --target gripper-build-and-test
working-directory: ot3-firmware

- name: 'Setup state_manager'
run: cmake --build ./build-host/ --target state-manager-setup
working-directory: ot3-firmware

- name: 'Build simulator'
run: cmake --build ./build-host --target gripper-simulator
working-directory: ot3-firmware

- name: "Upload artifacts"
if: github.event_name != 'pull_request'
uses: actions/upload-artifact@v3
with:
name: "gripper-simulator-${{github.ref_name}}"
path: |
build-host/gripper/simulator/gripper-simulator
target: 'gripper'

0 comments on commit 16177fe

Please sign in to comment.