Skip to content

Commit

Permalink
praise the lord
Browse files Browse the repository at this point in the history
  • Loading branch information
ahiuchingau committed Jan 12, 2024
1 parent a00ad12 commit 713f668
Show file tree
Hide file tree
Showing 4 changed files with 196 additions and 93 deletions.
17 changes: 12 additions & 5 deletions .github/actions/build-simulator/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,21 @@ name: Simulate
description: Build Target Simulator

inputs:
target:
description: simulator target
required: true
sub-target:
description: simulator sub-target
required: false

runs:
using: composite
steps:
- name: Build and test
run: cmake --build ./build-host --target ${{ inputs.target }}-simulator
- if: ${{ !inputs.sub-target }}
name: Build and test
run: cmake --build ./build-host --target ${{ env.TARGET }}-simulator
shell: bash
working-directory: ${{ env.DEFAULT_DIRECTORY }}

- if: ${{ inputs.sub-target }}
name: Build and test
run: cmake --build ./build-host --target ${{ env.TARGET }}-${{ inputs.sub-target }}-simulator
shell: bash
working-directory: ${{ env.DEFAULT_DIRECTORY }}
4 changes: 2 additions & 2 deletions .github/workflows/eeprom.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,5 @@ jobs:
run-non-executable-workflow:
uses: ./.github/workflows/non-executable-workflow.yaml
with:
target: bootloader
secrets: eeprom
target: eeprom
secrets: inherit
88 changes: 88 additions & 0 deletions .github/workflows/executable-workflow.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
name: Workflow for Executable Targets

on:
workflow_call:
inputs:
target:
description: Executable target
required: true
type: string
sub-targets:
description: Sub-targets
required: false
type: string


env:
ci: 1
DEFAULT_DIRECTORY: ot3-firmware
TARGET: ${{ inputs.target }}

defaults:
run:
shell: bash
working-directory: ot3-firmware

jobs:
cross-compile-check:
name: "Cross-Compile/Check"
runs-on: "ubuntu-20.04"
timeout-minutes: 10
steps:
- name: Checkout github actions directory
uses: actions/checkout@v4
with:
sparse-checkout: |
.github/actions
sparse-checkout-cone-mode: false
path: actions

- name: Setup main
uses: ./actions/.github/actions/main-setup
with:
cache-version: ${{ secrets.CACHE_VERSION }}

- name: Cross-Compile/Check
uses: ./actions/.github/actions/cross-compile-check

# cross-compile-build:
# name: "Cross-Compile/Build"
# needs: cross-compile-check
# strategy:
# matrix:
# build-target: ${{ fromJSON(inputs.sub-targets) }}
# steps:
# uses: ./actions/.github/actions/cross-compile-build
# sub-target: ${{ matrix.build-target || ""}}


host-compile-test:
name: "Host-Compile/Test"
runs-on: "ubuntu-20.04"
timeout-minutes: 10
steps:
- name: Checkout github actions directory
uses: actions/checkout@v4
with:
sparse-checkout: |
.github/actions
sparse-checkout-cone-mode: false
path: actions

- name: Setup main
uses: ./actions/.github/actions/main-setup
with:
cache-version: ${{ secrets.CACHE_VERSION }}

- name: Host-Compile/Test
uses: ./actions/.github/actions/host-compile-test

build-simulator:
name: "Build Simulator"
needs: host-build-test
strategy:
matrix:
build-target: ${{ fromJSON(inputs.sub-targets) }}
steps:
uses: ./actions/.github/actions/cross-compile-build
sub-target: ${{ matrix.build-target || ""}}
180 changes: 94 additions & 86 deletions .github/workflows/gantry.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,90 +37,98 @@ on:
- "gantry@*"
workflow_dispatch:

env:
ci: 1
DEFAULT_DIRECTORY: ot3-firmware
TARGET: gantry

defaults:
run:
shell: bash
working-directory: ot3-firmware

jobs:
cross-compile-check:
name: "Cross-Compile/Check"
runs-on: "ubuntu-20.04"
timeout-minutes: 20
steps:
- uses: "actions/checkout@v2"
with:
fetch-depth: 0
- uses: "actions/cache@v3"
with:
path: "./stm32-tools"
key: ${{ runner.os }}-${{ hashFiles('**/cmake/*') }}-${{ secrets.CACHE_VERSION }}
- name: "Configure"
run: cmake --preset=cross . -DCMAKE_BUILD_TYPE=RelWithDebInfo
- name: "Format"
run: cmake --build ./build-cross --target gantry-format-ci
- name: "Build"
run: cmake --build --preset=gantry --target gantry-images gantry-applications
- name: "Lint"
run: cmake --build ./build-cross --target gantry-lint

host-compile-test:
name: "Host-Compile/Test"
runs-on: "ubuntu-20.04"
timeout-minutes: 10
steps:
- name: Update and install gcc-10 & g++-10
run: |
sudo apt update
sudo apt install gcc-10 g++-10
- name: Checkout ot3-firmware repository
uses: "actions/checkout@v2"
with:
fetch-depth: 0
path: ot3-firmware

- name: Checkout opentrons repository
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'
run: cmake --build ./build-host --target gantry-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 X simulator'
run: cmake --build ./build-host --target gantry-x-simulator
working-directory: ot3-firmware

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

- name: "Upload simulator artifacts"
if: github.event_name != 'pull_request'
uses: actions/upload-artifact@v3
with:
name: "gantry-simulators-${{github.ref_name}}"
path: |
build-host/gantry/simulator/gantry-*-simulator
run-executable-workflow:
uses: ./.github/workflows/executable-workflow.yaml
with:
target: gantry
sub-target: '["x", "y"]'
secrets: inherit
#
#env:
# ci: 1
# DEFAULT_DIRECTORY: ot3-firmware
# TARGET: gantry
#
#defaults:
# run:
# shell: bash
# working-directory: ot3-firmware
#
#jobs:
# cross-compile-check:
# name: "Cross-Compile/Check"
# runs-on: "ubuntu-20.04"
# timeout-minutes: 20
# steps:
# - uses: "actions/checkout@v2"
# with:
# fetch-depth: 0
# - uses: "actions/cache@v3"
# with:
# path: "./stm32-tools"
# key: ${{ runner.os }}-${{ hashFiles('**/cmake/*') }}-${{ secrets.CACHE_VERSION }}
# - name: "Configure"
# run: cmake --preset=cross . -DCMAKE_BUILD_TYPE=RelWithDebInfo
# - name: "Format"
# run: cmake --build ./build-cross --target gantry-format-ci
# - name: "Build"
# run: cmake --build --preset=gantry --target gantry-images gantry-applications
# - name: "Lint"
# run: cmake --build ./build-cross --target gantry-lint
#
# host-compile-test:
# name: "Host-Compile/Test"
# runs-on: "ubuntu-20.04"
# timeout-minutes: 10
# steps:
# - name: Update and install gcc-10 & g++-10
# run: |
# sudo apt update
# sudo apt install gcc-10 g++-10
#
# - name: Checkout ot3-firmware repository
# uses: "actions/checkout@v2"
# with:
# fetch-depth: 0
# path: ot3-firmware
#
# - name: Checkout opentrons repository
# 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'
# run: cmake --build ./build-host --target gantry-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 X simulator'
# run: cmake --build ./build-host --target gantry-x-simulator
# working-directory: ot3-firmware
#
# - name: 'Build Y simulator'
# run: cmake --build ./build-host --target gantry-y-simulator
# working-directory: ot3-firmware
#
# - name: "Upload simulator artifacts"
# if: github.event_name != 'pull_request'
# uses: actions/upload-artifact@v3
# with:
# name: "gantry-simulators-${{github.ref_name}}"
# path: |
# build-host/gantry/simulator/gantry-*-simulator

0 comments on commit 713f668

Please sign in to comment.