diff --git a/.github/actions/cache-stm32-tools/action.yaml b/.github/actions/cache-stm32-tools/action.yaml deleted file mode 100644 index d81b66e10..000000000 --- a/.github/actions/cache-stm32-tools/action.yaml +++ /dev/null @@ -1,12 +0,0 @@ -name: 'Cache STM32 Tools' -description: 'Find stm32-tools cache' - -runs: - using: 'composite' - steps: - - 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 }} diff --git a/.github/actions/cross-compile-check/action.yaml b/.github/actions/cross-compile-check/action.yaml new file mode 100644 index 000000000..672f00d6f --- /dev/null +++ b/.github/actions/cross-compile-check/action.yaml @@ -0,0 +1,21 @@ +name: Cross-Compile/Check +description: Configure, Format and Build target + +runs: + using: composite + steps: + - name: Configure G4 + run: cmake --preset=cross . + working-directory: ${{ env.DEFAULT_DIRECTORY }} + + - name: Format + run: cmake --build ./build-cross --target ${{ env.TARGET }}-format-ci + working-directory: ${{ env.DEFAULT_DIRECTORY }} + + - name: Build g4 + run: cmake --build --preset=${{ env.TARGET }} + working-directory: ${{ env.DEFAULT_DIRECTORY }} + + - name: Lint + run: cmake --build ./build-cross --target ${{ env.TARGET }}-lint + working-directory: ${{ env.DEFAULT_DIRECTORY }} diff --git a/.github/actions/cross-compile-setup/action.yaml b/.github/actions/cross-compile-setup/action.yaml deleted file mode 100644 index 65b17b5f0..000000000 --- a/.github/actions/cross-compile-setup/action.yaml +++ /dev/null @@ -1,18 +0,0 @@ -name: 'Cross Compile Setup' -description: 'Set up the environment for cross compile' - -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: Cache stm32 tools - uses: './.github/actions/cache-stm32-tools' - - - name: Configure - shell: bash - run: cmake --preset=cross . diff --git a/.github/actions/host-compile-setup/action.yaml b/.github/actions/host-compile-setup/action.yaml deleted file mode 100644 index 75573ecc7..000000000 --- a/.github/actions/host-compile-setup/action.yaml +++ /dev/null @@ -1,31 +0,0 @@ -name: 'Host Compile Setup' -description: 'Set up the environment for host compile' - -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 - uses: actions/setup-python@v4 - with: - python-version: "3.10" - - - name: Cache stm32 tools - uses: './.github/actions/cache-stm32-tools' - - - name: Check out Opentrons monorepo - uses: actions/checkout@v4 - with: - repository: 'Opentrons/opentrons' - path: opentrons - - - name: Configure - working-directory: ot3-firmware - shell: bash - run: cmake --preset=host-gcc10 . - diff --git a/.github/actions/main-setup/action.yaml b/.github/actions/main-setup/action.yaml index f2c0c5e6f..df5c0cc67 100644 --- a/.github/actions/main-setup/action.yaml +++ b/.github/actions/main-setup/action.yaml @@ -23,13 +23,13 @@ runs: - name: Checkout ot3-firmware repository uses: actions/checkout@v4 with: - path: ot3-firmware + path: ${{ env.DEFAULT_DIRECTORY }} - name: Cache STM32 Tools uses: actions/cache@v3 id: cache-tools with: - path: ot3-firmware/stm32-tools + path: ${{ env.DEFAULT_DIRECTORY }}/stm32-tools key: ${{ runner.os }}-${{ hashFiles('**/cmake/*') }}-${{ inputs.cache-version }} - name: Setup opentrons monorepo diff --git a/.github/workflows/bootloader.yaml b/.github/workflows/bootloader.yaml index c47dfddf2..cd1588b08 100644 --- a/.github/workflows/bootloader.yaml +++ b/.github/workflows/bootloader.yaml @@ -31,9 +31,15 @@ on: - "bootloader@*" workflow_dispatch: +env: + ci: 1 + DEFAULT_DIRECTORY: ot3-firmware + TARGET: bootloader + defaults: run: shell: bash + working-directory: ${{ env.DEFAULT_DIRECTORY }} jobs: cross-compile-check: @@ -41,21 +47,22 @@ jobs: runs-on: "ubuntu-20.04" timeout-minutes: 10 steps: - - uses: "actions/checkout@v2" + - name: Checkout github actions directory + uses: actions/checkout@v4 with: - fetch-depth: 0 - - uses: "actions/cache@v3" + sparse-checkout: | + .github/actions + sparse-checkout-cone-mode: false + path: actions + + - name: Setup main + uses: ./actions/.github/actions/main-setup with: - path: "./stm32-tools" - key: ${{ runner.os }}-${{ hashFiles('**/cmake/*') }}-${{ secrets.CACHE_VERSION }} - - name: "Configure g4" - run: cmake --preset=cross . - - name: "Format" - run: cmake --build ./build-cross --target bootloader-format-ci - - name: "Build g4" - run: cmake --build --preset=bootloader - - name: "Lint" - run: cmake --build ./build-cross --target bootloader-lint + cache-version: ${{ secrets.CACHE_VERSION }} + + - name: Cross-Compile/Check + uses: ./actions/.github/actions/cross-compile-check + host-compile-test: name: "Host-Compile/Test" runs-on: "ubuntu-20.04" diff --git a/.github/workflows/gripper.yaml b/.github/workflows/gripper.yaml index d547b4d27..53a31da3c 100644 --- a/.github/workflows/gripper.yaml +++ b/.github/workflows/gripper.yaml @@ -45,11 +45,12 @@ on: env: ci: 1 + default-directory: ot-firmware defaults: run: shell: bash - working-directory: ot3-firmware + working-directory: ${{ env.default-directory }} jobs: cross-compile-check: @@ -72,8 +73,6 @@ jobs: - name: Configure run: cmake --preset=cross . - working-directory: ot3-firmware - - name: "Format" run: cmake --build ./build-cross --target gripper-format-ci - name: "Build"