From c8d5f9edc595280ab81d20afc98b8d4520baddc2 Mon Sep 17 00:00:00 2001 From: crueter Date: Mon, 26 Jan 2026 19:52:02 -0500 Subject: [PATCH] CI: Deduplicate common build/rootFS setup steps 6 steps use this verbatim, and steamrt4 does as well (minus rootfs stuff). Less LoC and whatnot, you get the drill Signed-off-by: crueter --- .github/workflows/ccpp.yml | 19 ++------------- .github/workflows/glibc_fault.yml | 19 ++------------- .github/workflows/hostrunner.yml | 19 ++------------- .github/workflows/instcountci.yml | 19 ++------------- .github/workflows/mingw_build.yml | 19 ++------------- .github/workflows/setup-env/action.yml | 32 ++++++++++++++++++++++++++ .github/workflows/steamrt4.yml | 11 ++++----- .github/workflows/vixl_simulator.yml | 19 ++------------- 8 files changed, 48 insertions(+), 109 deletions(-) create mode 100644 .github/workflows/setup-env/action.yml diff --git a/.github/workflows/ccpp.yml b/.github/workflows/ccpp.yml index 5fd3ee48a..2845c295a 100644 --- a/.github/workflows/ccpp.yml +++ b/.github/workflows/ccpp.yml @@ -31,23 +31,8 @@ jobs: echo "runner_label=${{ matrix.arch[1] }}" >> $GITHUB_ENV echo "runner_name=$(hostname)" >> $GITHUB_ENV - - name: Set rootfs paths - run: | - echo "FEX_ROOTFS_MOUNT=/mnt/AutoNFS/rootfs/" >> $GITHUB_ENV - echo "FEX_ROOTFS_PATH=$HOME/Rootfs/" >> $GITHUB_ENV - echo "FEX_ROOTFS=$HOME/Rootfs/" >> $GITHUB_ENV - - - name: Update RootFS cache - run: python3 Scripts/CI_FetchRootFS.py - - - name: Checkout Submodules - # Need to update submodules - run: | - git submodule sync --recursive - git submodule update --init --depth 1 - - - name: Clean Build Environment - run: rm -Rf build + - name: Setup Build Environment + uses: ./.github/workflows/setup-env - name: Configure CMake run: | diff --git a/.github/workflows/glibc_fault.yml b/.github/workflows/glibc_fault.yml index 25a7e900c..c4d2d9529 100644 --- a/.github/workflows/glibc_fault.yml +++ b/.github/workflows/glibc_fault.yml @@ -38,23 +38,8 @@ jobs: echo "runner_label=${{ matrix.arch[1] }}" >> $GITHUB_ENV echo "runner_name=$(hostname)" >> $GITHUB_ENV - - name: Set rootfs paths - run: | - echo "FEX_ROOTFS_MOUNT=/mnt/AutoNFS/rootfs/" >> $GITHUB_ENV - echo "FEX_ROOTFS_PATH=$HOME/Rootfs/" >> $GITHUB_ENV - echo "FEX_ROOTFS=$HOME/Rootfs/" >> $GITHUB_ENV - - - name: Update RootFS cache - run: python3 Scripts/CI_FetchRootFS.py - - - name: Checkout Submodules - # Need to update submodules - run: | - git submodule sync --recursive - git submodule update --init --depth 1 - - - name: Clean Build Environment - run: rm -Rf build + - name: Setup Build Environment + uses: ./.github/workflows/setup-env - name: Configure CMake run: | diff --git a/.github/workflows/hostrunner.yml b/.github/workflows/hostrunner.yml index 734e296b7..332840c7f 100644 --- a/.github/workflows/hostrunner.yml +++ b/.github/workflows/hostrunner.yml @@ -31,23 +31,8 @@ jobs: echo "runner_label=${{ matrix.arch[1] }}" >> $GITHUB_ENV echo "runner_name=$(hostname)" >> $GITHUB_ENV - - name: Set rootfs paths - run: | - echo "FEX_ROOTFS_MOUNT=/mnt/AutoNFS/rootfs/" >> $GITHUB_ENV - echo "FEX_ROOTFS_PATH=$HOME/Rootfs/" >> $GITHUB_ENV - echo "FEX_ROOTFS=$HOME/Rootfs/" >> $GITHUB_ENV - - - name: Update RootFS cache - run: python3 Scripts/CI_FetchRootFS.py - - - name: Checkout Submodules - # Need to update submodules - run: | - git submodule sync --recursive - git submodule update --init --depth 1 - - - name: Clean Build Environment - run: rm -Rf build + - name: Setup Build Environment + uses: ./.github/workflows/setup-env - name: Configure CMake run: | diff --git a/.github/workflows/instcountci.yml b/.github/workflows/instcountci.yml index fe4465030..a462d7fd0 100644 --- a/.github/workflows/instcountci.yml +++ b/.github/workflows/instcountci.yml @@ -30,23 +30,8 @@ jobs: echo "runner_label=${{ matrix.arch[1] }}" >> $GITHUB_ENV echo "runner_name=$(hostname)" >> $GITHUB_ENV - - name: Set rootfs paths - run: | - echo "FEX_ROOTFS_MOUNT=/mnt/AutoNFS/rootfs/" >> $GITHUB_ENV - echo "FEX_ROOTFS_PATH=$HOME/Rootfs/" >> $GITHUB_ENV - echo "FEX_ROOTFS=$HOME/Rootfs/" >> $GITHUB_ENV - - - name: Update RootFS cache - run: python3 Scripts/CI_FetchRootFS.py - - - name: Checkout Submodules - # Need to update submodules - run: | - git submodule sync --recursive - git submodule update --init --depth 1 - - - name: Clean Build Environment - run: rm -Rf build + - name: Setup Build Environment + uses: ./.github/workflows/setup-env - name: Set vixl_sim x86 if: matrix.arch[1] == 'x64' diff --git a/.github/workflows/mingw_build.yml b/.github/workflows/mingw_build.yml index 763ee075c..9d2d93215 100644 --- a/.github/workflows/mingw_build.yml +++ b/.github/workflows/mingw_build.yml @@ -43,23 +43,8 @@ jobs: run: | echo "MINGW_TRIPLE=arm64ec-w64-mingw32" >> $GITHUB_ENV - - name: Set rootfs paths - run: | - echo "FEX_ROOTFS_MOUNT=/mnt/AutoNFS/rootfs/" >> $GITHUB_ENV - echo "FEX_ROOTFS_PATH=$HOME/Rootfs/" >> $GITHUB_ENV - echo "FEX_ROOTFS=$HOME/Rootfs/" >> $GITHUB_ENV - - - name: Update RootFS cache - run: python3 Scripts/CI_FetchRootFS.py - - - name: Checkout Submodules - # Need to update submodules - run: | - git submodule sync --recursive - git submodule update --init --depth 1 - - - name: Clean Build Environment - run: rm -Rf build + - name: Setup Build Environment + uses: ./.github/workflows/setup-env - name: Configure CMake run: | diff --git a/.github/workflows/setup-env/action.yml b/.github/workflows/setup-env/action.yml new file mode 100644 index 000000000..46fd1d4b9 --- /dev/null +++ b/.github/workflows/setup-env/action.yml @@ -0,0 +1,32 @@ +name: Setup Build Environment + +inputs: + setup-rootfs: + description: 'Whether or not to set up the rootfs' + default: true + +runs: + using: composite + steps: + - name: Set rootfs paths + if: ${{ inputs.setup-rootfs == 'true' }} + shell: bash + run: | + echo "FEX_ROOTFS_MOUNT=/mnt/AutoNFS/rootfs/" >> $GITHUB_ENV + echo "FEX_ROOTFS_PATH=$HOME/Rootfs/" >> $GITHUB_ENV + echo "FEX_ROOTFS=$HOME/Rootfs/" >> $GITHUB_ENV + + - name: Update RootFS cache + if: ${{ inputs.setup-rootfs == 'true' }} + shell: bash + run: python3 Scripts/CI_FetchRootFS.py + + - name: Checkout Submodules + shell: bash + run: | + git submodule sync --recursive + git submodule update --init --depth 1 + + - name: Clean Build Environment + shell: bash + run: rm -Rf build diff --git a/.github/workflows/steamrt4.yml b/.github/workflows/steamrt4.yml index b5584e242..2e6cfc2b8 100644 --- a/.github/workflows/steamrt4.yml +++ b/.github/workflows/steamrt4.yml @@ -27,13 +27,10 @@ jobs: - name: Set runner label run: echo "runner_label=${{ matrix.arch[1] }}" >> $GITHUB_ENV - - name: Checkout Submodules - run: | - git submodule sync --recursive - git submodule update --init --depth 1 - - - name: Clean Build Environment - run: rm -Rf build + - name: Setup Build Environment + uses: ./.github/workflows/setup-env + with: + setup-rootfs: false # Setup everything required. - name : distrobox setup diff --git a/.github/workflows/vixl_simulator.yml b/.github/workflows/vixl_simulator.yml index 32324cb2e..cf89583d5 100644 --- a/.github/workflows/vixl_simulator.yml +++ b/.github/workflows/vixl_simulator.yml @@ -32,23 +32,8 @@ jobs: echo "runner_label=${{ matrix.arch[1] }}" >> $GITHUB_ENV echo "runner_name=$(hostname)" >> $GITHUB_ENV - - name: Set rootfs paths - run: | - echo "FEX_ROOTFS_MOUNT=/mnt/AutoNFS/rootfs/" >> $GITHUB_ENV - echo "FEX_ROOTFS_PATH=$HOME/Rootfs/" >> $GITHUB_ENV - echo "FEX_ROOTFS=$HOME/Rootfs/" >> $GITHUB_ENV - - - name: Update RootFS cache - run: python3 Scripts/CI_FetchRootFS.py - - - name: Checkout Submodules - # Need to update submodules - run: | - git submodule sync --recursive - git submodule update --init --depth 1 - - - name: Clean Build Environment - run: rm -Rf build + - name: Setup Build Environment + uses: ./.github/workflows/setup-env - name: Configure CMake run: |