We use GitHub Actions for continuous automation (CI) and continuous delivery (CD) workflows:
Workflows are defined directly in the repository at .github/workflows/. We use a mix of GitHub-hosted runners and self-hosted runners to get automated build and test coverage across a variety of platforms and hardware accelerators.
(Read more on https://docs.github.com/en/actions/learn-github-actions/understanding-github-actions)
These workflows build the project from source then run unit tests.
| Workflow file | Build status | Event triggers |
|---|---|---|
ci.yml | pull_request, push | |
ci_linux_arm64_clang.yml | schedule | |
ci_macos_arm64_clang.yml | schedule | |
ci_linux_x64_clang_byollvm.yml | schedule | |
ci_linux_x64_clang_debug.yml | schedule | |
ci_linux_x64_clang_tsan.yml | schedule | |
ci_linux_x64_gcc.yml | schedule |
These workflows build packages from source then run test suites using them.
iree-compile and any other host tools from the built packages.tensorflow, torch) and fetch from model repositories like Hugging Face as needed to run test suites.!!! Tip
PkgCI workflows can be triggered directly to skip the 5-10 minute build "build packages" job when testing workflows. See the [faster iteration on PkgCI workflows](#faster-iteration-on-pkgci-workflows) section below for details.
| Workflow file | Build status | Event triggers |
|---|---|---|
| Package tests | ||
pkgci.yml | pull_request, push |
| Workflow file | Build status | Event triggers |
|---|---|---|
build_package.yml | schedule | |
publish_website.yml | push, release, schedule | |
samples.yml | schedule |
Workflow files typically require some external dependencies in the form of software packages, environment settings, and sometimes even system/hardware drivers. One way to manage these dependencies is to bundle them into a container using a tool like Docker.
!!! tip
We recommend only using Docker containers within workflow files in specific cicumstances and with moderation. IREE contains a cross-compiler and minimal runtime, both of which are designed to run on a wide range of systems. Using carefully constructed containers for basic development risks the project _only_ working within such containers.
These sorts of dependencies may be a good fit for using Docker containers:
Here are alternative ways to fetch and configure workflow/job dependencies:
pip or apt.PATH.Of the events that trigger workflows, we most commonly use:
pull_requestpushpull_request.scheduleworkflow_dispatch!!! info - ““Presubmit” and “postsubmit””
We use the terminology "presubmit" and "postsubmit" to differentiate between stages when checks run: * "Presubmit" checks run on code that has not yet been reviewed/approved/merged with either of the `pull_request` or `workflow_dispatch` triggers. * "Postsubmit" checks run on code that has been merged to a common branch like `main` with either of the `push` or `schedule` triggers. In an ideal world every check would run on presubmit, but some operating system or hardware runners are in short supply and some workflows are slow even with sufficient resources (e.g. benchmark suites). We try to strike a balance between utility and economics.
!!! example - “Example workflow triggers”
* [`ci_linux_x64_clang_asan.yml`](https://github.com/iree-org/iree/blob/main/.github/workflows/ci_linux_x64_clang_asan.yml) runs on presubmit (`pull_request` trigger) and postsubmit (`push` trigger). Even though this workflow builds the compiler and needs to use large build machines because, it is generally useful for all C/C++ compiler and runtime changes. * [`ci_linux_x64_clang_tsan.yml`](https://github.com/iree-org/iree/blob/main/.github/workflows/ci_linux_x64_clang_tsan.yml) is similar to the ASan build but it runs on the `schedule` event because it is only situationally useful and we want to limit use of large build machines. It would run on GitHub-hosted runners if they could handle it without running out of disk space. * [`ci_linux_arm64_clang.yml`](https://github.com/iree-org/iree/blob/main/.github/workflows/ci_linux_arm64_clang.yml) uses the `schedule` event since GitHub does not offer free Linux arm64 runners.
Any workflow that runs on the pull_request event can be either optional (the default) or required.
!!! note
Required checks must use only either standard GitHub-hosted runners or runners from the CPU builder pool.
For native GitHub stacks, CI and PkgCI run their selected build and test jobs only for the lowest unmerged pull request. This is the PR whose base branch matches the stack's base branch. It uses the normal presubmit job selection, including file filters and PR description trailers. Non-stacked PRs are unaffected.
Upper stack PRs still run setup, which reports that CI is deferred and selects no build or test jobs. Clang-tidy is also skipped. DCO and pre-commit retain their existing behavior on every layer. Both summary jobs still run, but ci_summary explicitly fails (with an explanation) to prevent the untested PR to merge together with the bottom PR.
After the bottom PR merges, the remaining PRs rebase. CI relies on the rebase of the remaining stack to reevaluate and trigger test jobs. The next PR then becomes eligible for normal presubmit CI.
PR description trailers such as ci-extra and ci-exactly cannot override stack deferral. Scheduled and postsubmit workflows are unaffected. One can still manually dispatch a workflow on a PR that is higher in the stack.
GitHub supports paths and paths-ignore filters for push and pull_request events that can be used to configure which workflows run based on paths modified. This mechanism is simple but somewhat limited in what it can express, so we have a custom mechanism for marking certain jobs as conditionally enabled:
Always run on push events, after pull requests are merged (postsubmit).
Jobs may be marked as opt-in for pull_request events (presubmit) by editing build_tools/github_actions/configure_ci.py. That script runs as part of the setup.yml action, which jobs can depend on like so:
jobs: setup: uses: ./.github/workflows/setup.yml test: needs: [setup] if: contains(fromJson(needs.setup.outputs.enabled-jobs), 'test') steps: - ...
Opt-in jobs can also be set up to run automatically if specific file paths are modified, much like GitHub's paths and paths-ignore filters.
To bypass the computed configuration of workflows to run, see the CI behavior manipulation section of our contributing guide.
We group runners into categories:
!!! info - “Contributing self-hosted runners”
Want to run tests on your own hardware as part of IREE's upstream CI? Get in touch with us on one of our [communication channels](../../index.md#communication-channels) and we'd be happy to discuss the options available.
Each pkgci workflow can be triggered directly with workflow_dispatch to run tests using a previous run of the build_packages job.
Find the artifact_run_id from a prior run to use packages from. You can go through the history at https://github.com/iree-org/iree/actions/workflows/pkgci.yml for this. For example, https://github.com/iree-org/iree/actions/runs/13723791082 has run id 13723791082.
Choose which workflow you want to run and navigate to its control page on https://github.com/iree-org/iree/actions, like https://github.com/iree-org/iree/actions/workflows/pkgci_unit_test.yml for pkgci_unit_test.yml.
Run the workflow using the workflow_dispatch trigger, selecting the branch you want to test and providing the artifact_run_id from step 1:
#github-ci channel in IREE's Discord server.Official:
Community: