forked from iree-org/iree
-
Notifications
You must be signed in to change notification settings - Fork 11
108 lines (103 loc) · 4.83 KB
/
build_all.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
103
104
105
106
107
108
# 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 building IREE. It is designed to be called from a parent workflow.
# The concurrency of this workflow is controlled by the caller's job.
name: Build All
on:
workflow_call:
inputs:
runner-group:
required: true
type: string
runner-env:
required: true
type: string
write-caches:
required: true
type: string
outputs:
install-dir:
description: Local install directory path.
value: ${{ jobs.build_all.outputs.install-dir }}
install-dir-archive:
description: Name of the zipped install directory.
value: ${{ jobs.build_all.outputs.install-dir-archive }}
install-dir-gcs-artifact:
description: GCS path to the uploaded install archive.
value: ${{ jobs.build_all.outputs.install-dir-gcs-artifact }}
env:
# This duplicates the variable from ci.yml. The variable needs to be in env
# instead of the outputs of setup because it contains the run attempt and we
# want that to be the current attempt, not whatever attempt the setup step
# last ran in. It therefore can't be passed in via inputs because the env
# context isn't available there.
GCS_DIR: gs://iree-github-actions-${{ github.event_name == 'pull_request' && 'presubmit' || 'postsubmit' }}-artifacts/${{ github.run_id }}/${{ github.run_attempt }}
jobs:
build_all:
runs-on:
- self-hosted # must come first
- runner-group=${{ inputs.runner-group }}
- environment=${{ inputs.runner-env }}
- cpu
- os-family=Linux
env:
BUILD_DIR: full-build-dir
INSTALL_DIR: full-build-dir/install
outputs:
install-dir: ${{ env.INSTALL_DIR }}
# Pass the install directory as output for other jobs to use.
# TODO(#16203): replace this with iree-dist packages
# The install directory provides a similar set of files and existing
# jobs are already configured to use the build directory, so this is
# an intermediate step towards a fully package-based CI setup.
install-dir-archive: ${{ steps.install-archive.outputs.install-dir-archive }}
install-dir-gcs-artifact: ${{ steps.install-upload.outputs.install-dir-gcs-artifact }}
steps:
- name: "Checking out repository"
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
with:
submodules: true
- name: "Building IREE"
env:
IREE_WRITE_REMOTE_CCACHE: ${{ inputs.write-caches }}
run: |
./build_tools/github_actions/docker_run.sh \
--env "IREE_CCACHE_GCP_TOKEN=$(gcloud auth application-default print-access-token)" \
--env "IREE_WRITE_REMOTE_CCACHE=${IREE_WRITE_REMOTE_CCACHE}" \
--env "CCACHE_NAMESPACE=gcr.io/iree-oss/base@sha256:61e9aae211007dbad95e1f429e9e5121fd5968c204791038424979c21146cf75" \
gcr.io/iree-oss/base@sha256:61e9aae211007dbad95e1f429e9e5121fd5968c204791038424979c21146cf75 \
./build_tools/cmake/build_all.sh "${BUILD_DIR}"
# TODO(scotttodd): trim build/tests to exclude integration tests (tests/ folder, check tests)
# that coverage should move to a test_cpu job (matrix with test_gpu?)
- name: "Testing IREE"
run: |
./build_tools/github_actions/docker_run.sh \
gcr.io/iree-oss/base@sha256:61e9aae211007dbad95e1f429e9e5121fd5968c204791038424979c21146cf75 \
./build_tools/cmake/ctest_all.sh "${BUILD_DIR}"
- name: "Testing iree-dialects"
run: |
./build_tools/github_actions/docker_run.sh \
gcr.io/iree-oss/base@sha256:61e9aae211007dbad95e1f429e9e5121fd5968c204791038424979c21146cf75 \
./build_tools/cmake/test_iree_dialects.sh "${BUILD_DIR}"
# TODO(#16203): If this (or iree-dist) is small enough, just use GitHub
# artifacts instead of `tar` commands and GCS
- name: "Creating install dir archive"
id: install-archive
env:
INSTALL_DIR_ARCHIVE: install_dir.tar.zst
run: |
tar -I 'zstd -T0' \
-cf ${INSTALL_DIR_ARCHIVE} ${INSTALL_DIR}
echo "install-dir-archive=${INSTALL_DIR_ARCHIVE}" >> "${GITHUB_OUTPUT}"
- name: "Uploading install dir archive"
id: install-upload
env:
INSTALL_DIR_ARCHIVE: ${{ steps.install-archive.outputs.install-dir-archive }}
INSTALL_DIR_GCS_ARTIFACT: ${{ env.GCS_DIR }}/${{ steps.install-archive.outputs.install-dir-archive }}
run: |
gcloud storage cp "${INSTALL_DIR_ARCHIVE}" "${INSTALL_DIR_GCS_ARTIFACT}"
echo "install-dir-gcs-artifact=${INSTALL_DIR_GCS_ARTIFACT}" >> "${GITHUB_OUTPUT}"