Skip to content

samples

samples #475

Workflow file for this run

# Copyright 2022 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
#
# Workflow for running Examples of IREE usage against releases periodically.
name: samples
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:
colab:
runs-on: ubuntu-20.04
steps:
- name: "Checking out repository"
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: "Setting up Python"
uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.1.0
with:
python-version: "3.11"
- name: "Testing Colab Notebooks"
run: ./samples/colab/test_notebooks.py
samples:
runs-on: ubuntu-20.04
env:
CC: clang
CXX: clang++
steps:
- name: "Checking out repository"
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: "Checking out runtime submodules"
run: ./build_tools/scripts/git/update_runtime_submodules.sh
- name: "Installing build dependencies"
run: sudo apt update && sudo apt install -y ninja-build
- name: "Setting up Python"
uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.1.0
with:
python-version: "3.11"
- name: "Testing Samples"
run: ./build_tools/testing/test_samples.sh
web:
runs-on: ubuntu-20.04
env:
VENV_DIR: ${{ github.workspace }}/.venv
CC: clang
CXX: clang++
defaults:
run:
shell: bash
steps:
- name: "Check out repository"
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: "Mark git safe.directory"
run: git config --global --add safe.directory '*'
- name: "Check out runtime submodules"
run: ./build_tools/scripts/git/update_runtime_submodules.sh
- name: "Installing build dependencies"
run: sudo apt update && sudo apt install -y ninja-build
- uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.1.0
with:
python-version: "3.11"
- name: "Setup Python venv"
run: |
python3 -m venv ${VENV_DIR}
source ${VENV_DIR}/bin/activate
python3 -m pip install \
--find-links https://iree.dev/pip-release-links.html \
--upgrade \
--pre \
iree-base-compiler \
iree-base-runtime
- name: "Setup emsdk"
uses: mymindstorm/setup-emsdk@6ab9eb1bda2574c4ddb79809fc9247783eaf9021 # v14
with:
version: 3.1.44
- name: "Test experimental web samples"
env:
HOST_TOOLS_BINARY_DIR: ${{ env.VENV_DIR }}/bin
IREE_EMPSCRIPTEN_BUILD_DIR: build-emscripten
run: |
source ${VENV_DIR}/bin/activate
./experimental/web/build_and_test_samples.sh ${HOST_TOOLS_BINARY_DIR}