| # 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 in-tree samples 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: | |
| if: ${{ github.repository_owner == 'iree-org' || github.event_name != 'schedule' }} | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - name: "Checking out repository" | |
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| - name: "Setting up Python" | |
| uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0 | |
| with: | |
| python-version: "3.11" | |
| - name: "Testing Colab Notebooks" | |
| run: ./samples/colab/test_notebooks.py | |
| samples: | |
| if: ${{ github.repository_owner == 'iree-org' || github.event_name != 'schedule' }} | |
| runs-on: ubuntu-24.04 | |
| env: | |
| CC: clang | |
| CXX: clang++ | |
| steps: | |
| - name: "Checking out repository" | |
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| - 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@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0 | |
| with: | |
| python-version: "3.11" | |
| - name: "Testing Samples" | |
| run: ./build_tools/testing/test_samples.sh | |
| web: | |
| if: ${{ github.repository_owner == 'iree-org' || github.event_name != 'schedule' }} | |
| runs-on: ubuntu-24.04 | |
| env: | |
| VENV_DIR: ${{ github.workspace }}/.venv | |
| CC: clang | |
| CXX: clang++ | |
| defaults: | |
| run: | |
| shell: bash | |
| steps: | |
| - name: "Check out repository" | |
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| - 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@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.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.74 | |
| - 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} | |
| # Aggregate job status and alerting on failures. | |
| samples_summary: | |
| if: always() | |
| needs: | |
| - colab | |
| - samples | |
| - web | |
| uses: ./.github/workflows/workflow_summary.yml | |
| secrets: inherit | |
| with: | |
| jobs-json: ${{ toJson(needs) }} |