From e19a65e31bd1636e6687b38286a59835d0a1224a Mon Sep 17 00:00:00 2001 From: ahiuchingau <20424172+ahiuchingau@users.noreply.github.com> Date: Fri, 12 Jan 2024 13:05:17 -0500 Subject: [PATCH] add main setup actions --- .../actions/cross-compile-setup/action.yaml | 1 - .github/actions/main-setup/action.yaml | 35 +++++++++++++++++++ .github/workflows/gripper.yaml | 22 ++++-------- 3 files changed, 41 insertions(+), 17 deletions(-) create mode 100644 .github/actions/main-setup/action.yaml diff --git a/.github/actions/cross-compile-setup/action.yaml b/.github/actions/cross-compile-setup/action.yaml index 7b757f88e..65b17b5f0 100644 --- a/.github/actions/cross-compile-setup/action.yaml +++ b/.github/actions/cross-compile-setup/action.yaml @@ -14,6 +14,5 @@ runs: uses: './.github/actions/cache-stm32-tools' - name: Configure - working-directory: ot3-firmware shell: bash run: cmake --preset=cross . diff --git a/.github/actions/main-setup/action.yaml b/.github/actions/main-setup/action.yaml new file mode 100644 index 000000000..a367c7b15 --- /dev/null +++ b/.github/actions/main-setup/action.yaml @@ -0,0 +1,35 @@ +name: ot3-firmware Repo Setup +description: Setup for ot3-firmware Github Actions + +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: Setup Python + if: ${{ contains(github.workflow, 'host') || contains(github.workflow, 'test')}} + uses: actions/setup-python@v4 + with: + python-version: 3.10 + + - name: Checkout ot3-firmware repository + uses: actions/checkout@v4 + with: + path: ot3-firmware + + - name: Cache STM32 Tools + uses: actions/cache@v3 + id: cache-tools + with: + path: ot3-firmware/stm32-tools + key: ${{ runner.os }}-${{ hashFiles('**/cmake/*') }}-${{ env.CACHE_VERSION }} + + - name: Setup opentrons monorepo + if: ${{ contains(github.workflow, 'host') || contains(github.workflow, 'test')}} + uses: actions/checkout@4 + with: + path: opentrons diff --git a/.github/workflows/gripper.yaml b/.github/workflows/gripper.yaml index de66b5d1e..f709d8750 100644 --- a/.github/workflows/gripper.yaml +++ b/.github/workflows/gripper.yaml @@ -58,19 +58,14 @@ jobs: runs-on: "ubuntu-20.04" timeout-minutes: 20 steps: - - name: Checkout ot3-firmware repository - uses: actions/checkout@v4 - with: - path: ot3-firmware - - - name: Checkout workflow/action directory + - name: Checkout github actions directory uses: actions/checkout@v4 with: sparse-checkout: '.github/' sparse-checkout-cone-mode: false - - name: Cross-compile setup - uses: './.github/actions/cross-compile-setup' + - name: Setup + uses: './github/actions/main-setup' - name: "Format" run: cmake --build ./build-cross --target gripper-format-ci @@ -84,19 +79,14 @@ jobs: runs-on: "ubuntu-20.04" timeout-minutes: 10 steps: - - name: Checkout ot3-firmware repository - uses: actions/checkout@v4 - with: - path: ot3-firmware - - - name: Checkout workflow/action directory + - name: Checkout github actions directory uses: actions/checkout@v4 with: sparse-checkout: '.github/' sparse-checkout-cone-mode: false - - name: Host Compile setup - uses: './.github/actions/host-compile-setup' + - name: Setup + uses: './github/actions/main-setup' # - name: 'Build and test' # run: cmake --build ./build-host --target gripper-build-and-test