-
Notifications
You must be signed in to change notification settings - Fork 619
102 lines (95 loc) · 3.46 KB
/
samples.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
# 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}