From fa394a4d305b171b808a9c270173344fee4adcd7 Mon Sep 17 00:00:00 2001 From: Scott Todd Date: Tue, 28 May 2024 14:20:26 -0700 Subject: [PATCH] Merge build_test_runtime jobs into a single matrix. --- .github/workflows/ci.yml | 145 ++++++++++++++++++++++----------------- 1 file changed, 81 insertions(+), 64 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3ab965a8b9bd8..c206afee735a6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -474,84 +474,101 @@ jobs: ############################################################################## build_test_runtime: needs: setup + name: "build_test_runtime :: ${{ matrix.os }}" if: contains(fromJson(needs.setup.outputs.enabled-jobs), 'build_test_runtime') - runs-on: ubuntu-20.04 + runs-on: ${{ matrix.runs-on }} + container: ${{ matrix.container }} + strategy: + fail-fast: false + matrix: + include: + - os: ubuntu-20.04 + runs-on: ubuntu-20.04 + container: gcr.io/iree-oss/base@sha256:dc314b4fe30fc1315742512891357bffed4d1b62ffcb46258b1e0761c737b446 + - os: windows-2022 + runs-on: windows-2022 + # No container, because Windows (https://github.com/actions/runner/issues/904). + - os: arm64 + runs-on: + - self-hosted # must come first + - runner-group=${{ needs.setup.outputs.runner-group }} + - environment=${{ needs.setup.outputs.runner-env }} + - arm64 + - os-family=Linux + container: gcr.io/iree-oss/base-arm64@sha256:9daa1cdbbf12da8527319ece76a64d06219e04ecb99a4cff6e6364235ddf6c59 env: BUILD_DIR: build-runtime + BUILD_PRESET: test steps: - name: "Checking out repository" uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 - name: "Checking out runtime submodules" run: ./build_tools/scripts/git/update_runtime_submodules.sh - - name: "Building runtime" - run: | - ./build_tools/github_actions/docker_run.sh \ - --env "BUILD_PRESET=test" \ - gcr.io/iree-oss/base@sha256:dc314b4fe30fc1315742512891357bffed4d1b62ffcb46258b1e0761c737b446 \ - ./build_tools/cmake/build_runtime.sh \ - "${BUILD_DIR}" - - name: "Testing runtime" - run: | - ./build_tools/github_actions/docker_run.sh \ - gcr.io/iree-oss/base@sha256:dc314b4fe30fc1315742512891357bffed4d1b62ffcb46258b1e0761c737b446 \ - ./build_tools/cmake/ctest_all.sh \ - "${BUILD_DIR}" - build_test_runtime_arm64: - needs: setup - if: contains(fromJson(needs.setup.outputs.enabled-jobs), 'build_test_runtime_arm64') - runs-on: - - self-hosted # must come first - - runner-group=${{ needs.setup.outputs.runner-group }} - - environment=${{ needs.setup.outputs.runner-env }} - - arm64 - - os-family=Linux - env: - BUILD_DIR: build-runtime-arm64 - steps: - - name: "Checking out repository" - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 - - name: "Checking out runtime submodules" - run: ./build_tools/scripts/git/update_runtime_submodules.sh - - name: "Building runtime" - run: | - ./build_tools/github_actions/docker_run.sh \ - --env "BUILD_PRESET=test" \ - gcr.io/iree-oss/base-arm64@sha256:9daa1cdbbf12da8527319ece76a64d06219e04ecb99a4cff6e6364235ddf6c59 \ - ./build_tools/cmake/build_runtime.sh \ - "${BUILD_DIR}" - - name: "Testing runtime" - run: | - ./build_tools/github_actions/docker_run.sh \ - gcr.io/iree-oss/base-arm64@sha256:9daa1cdbbf12da8527319ece76a64d06219e04ecb99a4cff6e6364235ddf6c59 \ - ./build_tools/cmake/ctest_all.sh \ - "${BUILD_DIR}" - - build_test_runtime_windows: - needs: setup - if: contains(fromJson(needs.setup.outputs.enabled-jobs), 'build_test_runtime_windows') - runs-on: windows-2022 - defaults: - run: - shell: bash - env: - BUILD_DIR: build-runtime-windows - steps: - - name: "Checking out repository" - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 - - name: "Checking out runtime submodules" - run: ./build_tools/scripts/git/update_runtime_submodules.sh - name: "Configuring MSVC" + if: contains(matrix.os, 'windows') uses: ilammy/msvc-dev-cmd@7315a94840631165970262a99c72cfb48a65d25d # v1.12.0 - - name: "Installing Python requirements" - run: pip install -r ./runtime/bindings/python/iree/runtime/build_requirements.txt + - name: "Building runtime" - env: - BUILD_PRESET: "test" run: ./build_tools/cmake/build_runtime.sh "${BUILD_DIR}" - name: "Testing runtime" run: ./build_tools/cmake/ctest_all.sh "${BUILD_DIR}" + # build_test_runtime_arm64: + # needs: setup + # if: contains(fromJson(needs.setup.outputs.enabled-jobs), 'build_test_runtime_arm64') + # runs-on: + # - self-hosted # must come first + # - runner-group=${{ needs.setup.outputs.runner-group }} + # - environment=${{ needs.setup.outputs.runner-env }} + # - arm64 + # - os-family=Linux + # env: + # BUILD_DIR: build-runtime-arm64 + # steps: + # - name: "Checking out repository" + # uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 + # - name: "Checking out runtime submodules" + # run: ./build_tools/scripts/git/update_runtime_submodules.sh + # - name: "Building runtime" + # run: | + # ./build_tools/github_actions/docker_run.sh \ + # --env "BUILD_PRESET=test" \ + # gcr.io/iree-oss/base-arm64@sha256:9daa1cdbbf12da8527319ece76a64d06219e04ecb99a4cff6e6364235ddf6c59 \ + # ./build_tools/cmake/build_runtime.sh \ + # "${BUILD_DIR}" + # - name: "Testing runtime" + # run: | + # ./build_tools/github_actions/docker_run.sh \ + # gcr.io/iree-oss/base-arm64@sha256:9daa1cdbbf12da8527319ece76a64d06219e04ecb99a4cff6e6364235ddf6c59 \ + # ./build_tools/cmake/ctest_all.sh \ + # "${BUILD_DIR}" + + # build_test_runtime_windows: + # needs: setup + # if: contains(fromJson(needs.setup.outputs.enabled-jobs), 'build_test_runtime_windows') + # runs-on: windows-2022 + # defaults: + # run: + # shell: bash + # env: + # BUILD_DIR: build-runtime-windows + # steps: + # - name: "Checking out repository" + # uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 + # - name: "Checking out runtime submodules" + # run: ./build_tools/scripts/git/update_runtime_submodules.sh + # - name: "Configuring MSVC" + # uses: ilammy/msvc-dev-cmd@7315a94840631165970262a99c72cfb48a65d25d # v1.12.0 + # - name: "Installing Python requirements" + # run: pip install -r ./runtime/bindings/python/iree/runtime/build_requirements.txt + # - name: "Building runtime" + # env: + # BUILD_PRESET: "test" + # run: ./build_tools/cmake/build_runtime.sh "${BUILD_DIR}" + # - name: "Testing runtime" + # run: ./build_tools/cmake/ctest_all.sh "${BUILD_DIR}" + ############################### Configurations ############################### # Jobs that build IREE in some non-default configuration ############################################################################## @@ -953,8 +970,8 @@ jobs: # Subsets - build_test_runtime - - build_test_runtime_arm64 - - build_test_runtime_windows + # - build_test_runtime_arm64 + # - build_test_runtime_windows # Configurations - python_release_packages