Skip to content

CI - Nightly

CI - Nightly #2

Workflow file for this run

# Copyright 2024 The IREE Authors
#
# Licensed under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
name: CI - Nightly
on:
schedule:
# Weekdays at 13:00 UTC = 05:00 PST / 06:00 PDT. No one should be dealing
# with this on weekends.
- cron: "5 4 * * 1-5"
workflow_dispatch:
permissions:
contents: read
concurrency:
# A PR number if a pull request and otherwise the commit hash. This cancels
# queued and in-progress runs for the same PR (presubmit) or commit
# (postsubmit). The workflow name is prepended to avoid conflicts between
# different workflows.
group: ${{ github.workflow }}-${{ github.event.number || github.sha }}
cancel-in-progress: true
jobs:
build_test_all_windows:
runs-on: windows-2022
defaults:
run:
shell: bash
env:
BUILD_DIR: build-windows
steps:
- name: "Checking out repository"
uses: actions/checkout@v4.1.7
with:
submodules: true
- name: "Setting up Python"
uses: actions/setup-python@v5.1.0
with:
python-version: "3.10" # Needs pybind >= 2.10.1 for Python >= 3.11
- name: "Installing Python packages"
run: |
python3 -m venv .venv
.venv/Scripts/activate.bat
python3 -m pip install -r runtime/bindings/python/iree/runtime/build_requirements.txt
- name: "Installing requirements"
run: choco install ccache --yes
- name: "Configuring MSVC"
uses: ilammy/msvc-dev-cmd@v1.13.0
# Finally: build and run tests.
- name: "Building IREE"
run: ./build_tools/cmake/build_all.sh "${BUILD_DIR}"
- name: "Testing IREE"
run: ./build_tools/cmake/ctest_all.sh "${BUILD_DIR}"
sanitizers:
name: "sanitizers :: ${{ matrix.name }}"
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
include:
- name: asan
script: ./build_tools/cmake/build_and_test_asan.sh
- name: tsan
script: ./build_tools/cmake/build_and_test_tsan.sh
steps:
- name: "Checking out repository"
uses: actions/checkout@v4.1.7
with:
submodules: true
- name: "Building and testing"
env:
SCRIPT: ${{ matrix.script }}
run: |
# Note that this uses the latest version of the clang compiler, etc.
# This gives us access to the latest features and validates that IREE
# builds using the latest versions.
./build_tools/github_actions/docker_run.sh \
gcr.io/iree-oss/base-bleeding-edge@sha256:cf2e78194e64fd0166f4141317366261d7a62432b72e9a324cb8c2ff4e1a515a \
${SCRIPT}
gcc:
runs-on: ubuntu-20.04
env:
BUILD_DIR: build-gcc
steps:
- name: "Checking out repository"
uses: actions/checkout@v4.1.7
with:
submodules: true
- name: "Building IREE with gcc"
run: |
./build_tools/github_actions/docker_run.sh \
--env CC=/usr/bin/gcc-9 \
--env CXX=/usr/bin/g++-9 \
--env CMAKE_BUILD_TYPE=Release \
--env "IREE_TARGET_BACKEND_WEBGPU_SPIRV=OFF" \
--env "IREE_BUILD_SETUP_PYTHON_VENV=${BUILD_DIR}/.venv" \
gcr.io/iree-oss/base@sha256:dc314b4fe30fc1315742512891357bffed4d1b62ffcb46258b1e0761c737b446 \
./build_tools/cmake/build_all.sh \
"${BUILD_DIR}"
debug:
runs-on: ubuntu-20.04
env:
BUILD_DIR: build-debug
steps:
- name: "Checking out repository"
uses: actions/checkout@v4.1.7
with:
submodules: true
- name: "Building IREE in Debug configuration"
run: |
./build_tools/github_actions/docker_run.sh \
--env "CMAKE_BUILD_TYPE=Debug" \
--env "IREE_BUILD_SETUP_PYTHON_VENV=${BUILD_DIR}/.venv" \
gcr.io/iree-oss/base@sha256:dc314b4fe30fc1315742512891357bffed4d1b62ffcb46258b1e0761c737b446 \
./build_tools/cmake/build_all.sh \
"${BUILD_DIR}"
byo_llvm:
runs-on: ubuntu-20.04
steps:
- name: "Checking out repository"
uses: actions/checkout@v4.1.7
with:
submodules: true
- name: "Building and testing with bring-your-own-LLVM"
run: |
./build_tools/github_actions/docker_run.sh \
gcr.io/iree-oss/base@sha256:dc314b4fe30fc1315742512891357bffed4d1b62ffcb46258b1e0761c737b446 \
./build_tools/cmake/build_and_test_byo_llvm.sh
##############################################################################
# Depends on all the other jobs to provide a single anchor that indicates the
# final status. Status reporting will become more sophisticated in the future
# and we can hopefully avoid the need to explicitly list every single job...
summary:
# Even if you have an explicit if condition, you still need to override
# GitHub's default behavior of not running if any dependencies failed.
if: always()
runs-on: ubuntu-20.04
needs:
- build_test_all_windows
- sanitizers
- gcc
- debug
- byo_llvm
steps:
- name: "Checking out repository"
uses: actions/checkout@v4.1.7
- name: Getting failed jobs
id: failed_jobs
run: |
echo '${{ toJson(needs) }}'
FAILED_JOBS="$(echo '${{ toJson(needs) }}' \
| jq --raw-output \
'map_values(select(.result!="success" and .result!="skipped")) | keys | join(",")' \
)"
echo "failed-jobs=${FAILED_JOBS}" >> $GITHUB_OUTPUT
if [[ "${FAILED_JOBS}" != "" ]]; then
echo "The following jobs failed: ${FAILED_JOBS}"
exit 1
fi
- name: Posting to Discord
uses: sarisia/actions-status-discord@v1.14.3
if: failure() && github.ref_name == 'main'
with:
webhook: ${{ secrets.DISCORD_WEBHOOK }}
description: "The following jobs failed: ${{ steps.failed_jobs.outputs.failed-jobs }}"
url: "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}/attempts/${{ github.run_attempt }}"